Thursday, 15 September 2011

Inscrutable clojure error messages

Clojure error messages are sometimes befuddling. Hope these help if you are stuck..

Exception: clojure.lang.Compiler$CompilerException: java.lang.Exception: EOF while reading (core.clj:78) 

This one is common enough..there is a parentheses missing.

Exception in thread "main" java.lang.Exception: Invalid token: /input (core.clj:64)

I struggled with this until I figured out that the parser complains about the next string declaration, if the previous string is missing trailing doublequotes.

Friday, 2 September 2011

Learning Clojure

I've been toying around with Clojure since it was released in 2009. Coming from Java-land, once you've gotten used to the expressiveness and brevity of Clojure, Java seems like a poor cousin.

For learning Clojure, I would suggest trying to solve some (or indeed, many) problems at Project Euler.

I started learning Clojure with "Programming Clojure", an excellent book by Stuart Halloway. Its a little pricey, and the only indian-edition book available is "Practical Clojure" (which I haven't read yet).

My Project Euler icon: