Bloling ClojureScript Error

the code

(defn sprintf [& args]
  (with-out-str
    (apply printf args)
    *out*))

Error

(Chrome)

Uncaught TypeError: Cannot read property 'cljs$lang$maxFixedArity' of undefined 

Question:

What am I doing wrong?

+5
source share
3 answers

(def sprintf format) looks lighter.

+1
source

Error:

Uncaught TypeError: Cannot read property 'cljs$lang$maxFixedArity' of undefined

... perhaps the story with the most obscure error message actually means:

You call applyfor a function that does not exist (or was not required).

Rock, future googlers!

+20
source

, , "No * print-fn * fn ".

https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs, * print-fn *:

" . , * print-fn * , , .

So, I suggest you play with * print-fn * - or, as @amalloy suggested, just use the "format" directly.

(By the way, if you look at https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure , that means "* out * is not currently implemented".)

0
source

All Articles