Is it possible to document fields in a record in clojure?

For example:

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

But this doesn't seem to work:

(doc Contract)

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

Maybe you can't document record fields?


defrecord compiles a new class and uses these names as the fields of that class. Unfortunatly classes predate clojure and leave no room for metadata :(

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

上一篇: 比较python中的字符串,如sql“like”(带有“%”和“

下一篇: 是否有可能在clojure中记录记录中的字段?