Hi,

I got the following and don't know what's wrong with it.

thanks in advance.

user=> (defn sum [ & more ]
  ((fn [total other]
    (if other
       (recur (+ total (first other)) (rest(other)))
  total))
0 more))
#'user/sum
user=> (sum [1 2 3 4])
java.lang.ClassCastException: clojure.lang.LazilyPersistentVector
cannot be cast to java.lang.Number (NO_SOURCE_FILE:0)




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to