Posted in the “I hope no-one else has to go through this” category in the hope that Google surfaces this for some other poor soul.
Picture a rather trivial split function:
(defn split [str delimiter] ((seq (.split str delimiter))))
Which helpfully spits out:
java.lang.ClassCastException: clojure.lang.ArraySeq cannot be cast to clojure.lang.IFn
The issue here is the additional set of parentheses – a hang-over from a previous edit. Removing this fixed the trouble. These parentheses were causing Clojure to expect a function call…
No Trackbacks
You can leave a trackback using this URL: http://www.magpiebrain.com/2010/06/13/in-clojure-those-parenthesis-really-matter/trackback/
One Comment
Thanks for the tip. Re the title: If they’re plural, then they’re parenthesEs.