Fork me on GitHub
#juxt
<
2020-02-20
>
borkdude11:02:17

$ random_doc.clj
#!/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)
$ random_doc.clj
-------------------------
clojure.core/juxt
([f] [f g] [f g h] [f g h & fs])
  Takes a set of functions and returns a fn that is the juxtaposition
  of those fns.  The returned fn takes a variable number of args, and
  returns a vector containing the result of applying each fn to the
  args (left-to-right).
  ((juxt a b c) x) => [(a x) (b x) (c x)]
it said juxt! (this is with bb 0.0.71, it has docstrings now, but the script also works with regular JVM clojure)

😁 28
👶 8
borkdude11:02:05

have a nice day

16