This function
(defn sum [& args] (apply + args))
should sum up all args sequence elements throws an exception. Why?
user> (defn sum [& args] (apply + args))
#'user/sum
user> (sum [1 2 3])
ClassCastException java.lang.Class.cast (Class.java:2999)
user> (sum (range 1 10))
ClassCastException java.lang.Class.cast (Class.java:2999)
(also used as example (which does not compile for me) in this question How to make a Clojure function take a variable number of parameters?)
I'm using nrepl in Emacs 24.2 Live with Clojure 1.5.1