I'm learning Clojure, and I find difficult to understand *where* a specific
compiler error happens:
java.lang.ClassCastException: java.lang.Long cannot be cast to
clojure.lang.IPersistentCollection, compiling:(fwpd/core.clj:100:1)
Line 100 is just:
(fib-seq3 5)
So it says nothing, because in fact the error is in the fib-seq3 function
(parameters to a "conj" call are inverted, see below).
Is this normal? No way to know where an error is???
Just for reference, here's the code (again, *I know where the error is*; I
just don't understand how was I supposed to find it, given that the message
doesn't tell me at which line it happens):
(defn fib-seq3
([to]
(fib-seq3 [] 0 1 0 to))
([coll a b k to]
(if (= k to)
coll
(fib-seq3 (conj b coll) b (+ a b) (inc k) to)))
(fib-seq3 5)
Thank you!
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.