Reputation:
(defn sprintf [& args]
(with-out-str
(apply printf args)
*out*))
(Chrome)
Uncaught TypeError: Cannot read property 'cljs$lang$maxFixedArity' of undefined
What am I doing wrong?
Upvotes: 5
Views: 1593
Reputation: 4210
The error:
Uncaught TypeError: Cannot read property 'cljs$lang$maxFixedArity' of undefined
...perhaps history's most baffling error message, actually means:
You're calling
apply
on a function that doesn't exist (or hasn't been required).
Rock on, future Googlers!
Upvotes: 20
Reputation: 2028
I don't get the error you saw, I get an error "No *print-fn* fn set for evaluation environment".
If you dig through the source at https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs you'll find this message in the docs for *print-fn* :
"Each runtime environment provides a diffenent way to print output. Whatever function *print-fn* is bound to will be passed any Strings which should be printed."
So I suggest you play around with *print-fn* - or as @amalloy suggested, just use 'format' directly.
(incidentally if you look at https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure it indicates "*out* is currently not implemented".)
Upvotes: 0