例如:
(defrecord Contract [^{:doc "primary identifiers..."} contract-id])
但这似乎不起作用:
(doc Contract)
clojure.lang.Cons cannot be cast to clojure.lang.Symbol
[Thrown class java.lang.ClassCastException]
也许你不能记录记录字段?
答案 0 :(得分:4)
defrecord编译一个新类,并使用这些名称作为该类的字段。不幸的是,类似于clojure并且没有留下元数据的空间:(
The class will have the (immutable) fields named by fields, which can have type hints.