Re: Documentation strings, declarations, markup, metadata
Lassi Kortela 25 May 2024 10:53 UTC
> that declarations are a kind of metadata. (Declarations are for the
> compiler and interpreter, whereas metadata is for the application, but I
> suspect the distinction would get muddy eventually.)
My bad. It already is muddy in Clojure.
It seems the docstring is stored in :doc.
user=> (pprint (meta #'+))
{:added "1.2",
:ns #object[clojure.lang.Namespace 0x3e134896 "clojure.core"],
:name +,
:file "clojure/core.clj",
:inline-arities
#object[clojure.core$_GT_1_QMARK_ 0x5b78fdb1
"clojure.core$xxxxxx@5b78fdb1"],
:column 1,
:line 986,
:arglists ([] [x] [x y] [x y & more]),
:doc
"Returns the sum of nums. (+) returns 0. Does not auto-promote\n
longs, will throw on overflow. See also: +'",
:inline
#object[clojure.core$nary_inline$fn__5606 0x3f36b447
"clojure.core$nary_inline$xxxxxx@3f36b447"]}