Is it possible to document fields in an entry in clojure?

For example:

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

But this does not work:

 (doc Contract) clojure.lang.Cons cannot be cast to clojure.lang.Symbol [Thrown class java.lang.ClassCastException] 

Perhaps you can’t document the record fields?

+7
source share
1 answer

defrecord compiles the new class and uses these names as the fields of this class. Unlucky classes precede clojure and leave no room for metadata :(

  The class will have the (immutable) fields named by
 fields, which can have type hints.
+4
source

All Articles