是否有可能在clojure中记录记录中的字段?

例如:

(defrecord Contract [^{:doc "primary identifiers..."} contract-id])

但是这似乎并不奏效:

(doc Contract)

clojure.lang.Cons cannot be cast to clojure.lang.Symbol
[Thrown class java.lang.ClassCastException]

也许你不能记录记录字段?


defrecord编译一个新类并将这些名称用作该类的字段。 不幸的课程早于clojure并且没有元数据的空间:(

The class will have the (immutable) fields named by
fields, which can have type hints.
链接地址: http://www.djcxy.com/p/55059.html

上一篇: Is it possible to document fields in a record in clojure?

下一篇: Is this a good pattern for my jQuery scripts?