Closed filipencopav closed 1 month ago
The function biff/pprint has the signature (pprint & args). However, its implementation only takes one argument.
biff/pprint
(pprint & args)
(require ['com.biffweb :as 'biff]) (biff/pprint 1) ;; Prints `1` (biff/pprint 1 2) ;; Unhandled clojure.lang.ArityException ;; Wrong number of args (2) passed to: com.biffweb.impl.util/pprint
Let's see what the definition of it is:
(defn pprint "Alias of clojure.pprint/pprint" [& args] (apply util/pprint args))
And util/pprint?
util/pprint
(defn pprint [x] (binding [*print-namespace-maps* false] (pp/pprint x)) (flush))
So, util/pprint takes strictly one argument, however biff/pprint will try to invoke it with 0 or more than 1 arguments. Why does biff/pprint have this counter-intuitive signature?
Thanks for the catch. I just pushed a commit to fix this: https://github.com/jacobobryant/biff/commit/edfd869b5866503d0ca2414874c1f37607c268ef
The function
biff/pprint
has the signature(pprint & args)
. However, its implementation only takes one argument.Let's see what the definition of it is:
And
util/pprint
?So,
util/pprint
takes strictly one argument, howeverbiff/pprint
will try to invoke it with 0 or more than 1 arguments. Why doesbiff/pprint
have this counter-intuitive signature?