James G. Sack (jim) wrote:
> Hey, I can answer that one! Tail recursion does not fix infinite
> recursion for you.
>   
Technically, the recursion limit is not there to catch infinite
recursion, but rather to prevent a stack overflow.
> The problem with your example would occur in any language.
>   
No. Some languages would blow their stack. Some languages would run out
of memory. Some languages would decide that there was a case of infinite
recursion and generate an error accordingly. Others might find it very
difficult to detect infinite recursion (kind of like the halting
problem... only not), so they might just hang indefinitely.

--Chris

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to