I don't get a stack overflow error, I get ArithmeticException integer 
overflow.  It's trying to compute an integer that's too big.  Try changing 
[1] to [1M] in (pascal n [1]).  

On Monday, February 3, 2014 3:19:36 PM UTC-6, Andy Smith wrote:
>
> Hi,
>
> I am working through the 4clojure questions, I have a few different 
> solutions to problem 87 but all of them run out of stack space. I tried to 
> convert to using recur but I still have the problem. Why does this fail for 
> large n?
>
> ((fn pascal ([n] (pascal n [1])) ([n row] (if (= n 1) row (recur (dec n) 
> (map (partial reduce +) (partition 2 1 (concat [0] row [0]))))))) 500)
>
> Andy
>

-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to