2009/10/19 Peregrine <stiebs...@gmail.com>:
>
> Hey I am new to Clojure and I am doing some Project Euler problems to
> help me get started with the language. I've run into a issue I cannot
> seem to get past. I have this code:
>
> (defn findFib
>        "Find the sum of all the even-valued terms in the sequence which do
> not exceed four million."
>        [e n p]
>        (if (< n 1000000)
>                (if (= (rem n 2) 0)
>                        (findFib (+ e n) (+ n p) (n))
>                        (findFib (e) (+ n p) (n)))
>        (str "Value is " e)))
>
> And I keep getting this error
>
> 1:9 problem2=> (findFib 0 1 2)
> 1:10 problem2=> java.lang.ClassCastException: java.lang.Integer cannot
> be cast to clojure.lang.IFn (repl-1:9)

Your question's already been answered, but to put it another way:

user=> 42
42
user=> (42)
java.lang.ClassCastException: java.lang.Integer cannot be cast to
clojure.lang.IFn (NO_SOURCE_FILE:0)
user=> (def x 42)
#'user/x
user=> x
42
user=> (x)
java.lang.ClassCastException: java.lang.Integer cannot be cast to
clojure.lang.IFn (NO_SOURCE_FILE:0)
user=>

-- 
Michael Wood <esiot...@gmail.com>

--~--~---------~--~----~------------~-------~--~----~
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
Note that posts from new members are moderated - please be patient with your 
first post.
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