Watch Your Parentheses – And nrepl-server Output

Situation: Emacs, cider 0.9, writing some Clojure code. Like this:

See the error? These three lines are part of a short program for producing graphics with Quil. Suppose radian-s and radian-t are seqences of numbers. The compiler swallowed it with without groaning, I ran the code and got an empty window. After checking and re-checking again I went through Emacs’ buffers and found a lot of error messages in nrepl-server:

Exception in :draw function: #
stacktrace: clojure.lang.ArityException: Wrong number of args (1) passed to: core/map
at clojure.lang.AFn.throwArity (AFn.java:429)

What? Why was this error coming up only at run-time and not when compiling? And which line didn’t work exactly? Short answer: it’s the last one which should look like this:

No idea why the wrong version slipped through, but it’s always a good idea to check the balance of parentheses, anyway. And to have a look at nrepl-server’s output. Certainly nothing new for Clojure experts, but noobs like me might learn from it.

About Manfred Berndtgen

Manfred Berndtgen, maintainer of this site, is a part-time researcher with enough spare time for doing useless things and sharing them with the rest of the world. His main photographic subjects are made of plants or stones, and since he's learning Haskell everything seems functional to him.