James, it will generate a stack overflow on a sufficiently large problem, 
certainly.

Most of the cases where recursions are a good idea are order (n^2) and 
worse algorithms, though, so the question is rather 'will the stack 
overflow before the heap is exhausted or the processor catches fire?'.
There are usually ways of dealing with cases where the recursion is just an 
iteration.

A stack depth of 1000000 should be livable with. A stack depth of 200 means 
the machine has trouble with problems I can do in my head.

Cheers, John.



On Monday, September 23, 2013 12:50:28 AM UTC+1, James Reeves wrote:
>
> On 23 September 2013 00:28, John Lawrence Aspden 
> <asp...@googlemail.com<javascript:>
> > wrote:
>
>> Nice, but it won't work for me, since I'm trying to avoid computing all 
>> the values in the table, and so I can't use the pump-priming approach. I 
>> don't know what values I'm going to need primed!
>> I'm sure there are ways round it, but I think they're all complicated and 
>> ugly. 
>>
>> I think I'll translate my program into python, where presumably it will 
>> just work. Or actually you've reminded me about Racket. I used to like that 
>> when it was PLT scheme.
>>
>
> As far as I can tell, the code you have will generate a stack overflow in 
> any language. It's not tail recursive, and the first time you run the 
> function it can't draw from the cache.
>
> - James
>

-- 
-- 
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