Browse files

simplify implementation of doc-from-ns-form

  • Loading branch information...
1 parent 430caf9 commit 2691432bd76fe334ebbacaae95de962fa712fb27 @ryantm ryantm committed Dec 20, 2013
Showing with 1 addition and 6 deletions.
  1. +1 −6 src/bultitude/core.clj
7 src/bultitude/core.clj
@@ -127,9 +127,4 @@
(defn doc-from-ns-form
"Extract the docstring from a given ns form without evaluating the form. The docstring returned should be the return value of (:doc (meta namespace-symbol)) if the ns-form were to be evaluated."
- (let [meta-docstring (:doc (meta (second ns-form)))
- references (next (next ns-form))
- docstring (when (string? (first references)) (first references))
- references (if docstring (next references) references)
- attribute-docstring (:doc (when (map? (first references)) (first references)))]
- (or attribute-docstring docstring meta-docstring)))
+ (:doc (meta (second (second (second (macroexpand ns-form)))))))

0 comments on commit 2691432

Please sign in to comment.