Improved strip-docstring to also remove empty metadata map.

This commit is contained in:
Nicolas Buduroi 2011-04-29 14:29:31 -04:00
parent 3f63422e5c
commit cfc5b0ff86

View file

@ -76,22 +76,10 @@
(replace "\"" "\\\""))
\")
"")
(replace #"#?\^\{\s*:doc\s*\}" "")
(replace #"\n\s*\n" "\n")
(replace #"\n\s*\)" ")")))
(defn- internal-strip-docstring
[R internal-ds]
(reduce (fn [raw docstring]
(replace
raw
(str \" (-> docstring
str
(replace "\"" "\\\""))
\")
""))
R
internal-ds))
(defn get-var-docstring [nspace-sym sym]
(try
(-> `(var ~(symbol (str nspace-sym) (str sym))) eval meta :doc)