clojure - 包含conj的接口(interface)?

标签 clojure deftype

作为练习,我正在开发一个类似于 Vector 的数据结构。我已经实现了 IPercientVector 扩展的所有接口(interface),但我还没有找到定义“conj”的接口(interface)。那是哪个界面? 谢谢!

最佳答案

clojure.lang.IPercientCollection/cons。它最初被命名为 cons,并且一直保留在界面中,尽管它的 Clojure 函数现在称为 conj

关于clojure - 包含conj的接口(interface)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8781213/

相关文章:

syntax - 为什么 Clojure 语言使用这么多括号?

clojure - 尽管 Clojure 中 Java 构造函数有类型提示,但仍出现反射警告

clojure - 如何使用 core.async channel 对 Rx 的 `withLatestFrom` 进行建模?

clojure - Clojure 测试中 stub HTTP 请求的策略

scheme - Common Lisp 和 Scheme 中 deftype 的区别

clojure - 干净地更新 deftype 类的字段

clojure - 在 Clojure 中相互引用 deftypes

regex - 如何编写 Clojure 宏以从字符串创建正则表达式?