Fork me on GitHub
#babashka
<
2021-02-18
>
Pradeep B16:02:55

@borkdude are you using babashka for ‘doc string of the day’ ? I was trying the simple clj -e "(doc first)" and it didn’t work 😞

borkdude16:02:17

@pradeep.bishnoi I am :)

#!/usr/bin/env bb

(require '[clojure.repl])

(defmacro random-doc []
  (let [sym (-> (ns-publics 'clojure.core) keys rand-nth)]
    (if (:doc (meta (resolve sym)))
      `(clojure.repl/doc ~sym)
      `(random-doc))))

(random-doc)

👀 3
thumbsup_all 12
Pradeep B16:02:47

and thanks for passing it.