Re: Beginner: java.lang.Integer cannot be cast to clojure.lang.IFn (repl)

2009-10-19 Thread Peregrine
Thanks everyone! This seems so obvious now that I look at it. On Oct 19, 10:55 am, Siddhartha Reddy wrote: > The arguments 'n' and 'e' to the calls to findFib on lines 7 and 8 are > enclosed in parens, causing them to be treated as lists. Clojure expects the > first element in a list to be a fun

Re: Beginner: java.lang.Integer cannot be cast to clojure.lang.IFn (repl)

2009-10-19 Thread Michael Wood
2009/10/19 Peregrine : > > 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

Re: Beginner: java.lang.Integer cannot be cast to clojure.lang.IFn (repl)

2009-10-19 Thread Siddhartha Reddy
The arguments 'n' and 'e' to the calls to findFib on lines 7 and 8 are enclosed in parens, causing them to be treated as lists. Clojure expects the first element in a list to be a function and is therefore trying to cast it to an IFn which of course fails. I think this is what you are looking for:

Re: Beginner: java.lang.Integer cannot be cast to clojure.lang.IFn (repl)

2009-10-19 Thread Jarkko Oranen
On Oct 19, 5:52 pm, Peregrine wrote: > 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

Beginner: java.lang.Integer cannot be cast to clojure.lang.IFn (repl)

2009-10-19 Thread Peregrine
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."