[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to do actual recursive functions in Lua?
- From: David Kastrup <dak@...>
- Date: Mon, 30 Mar 2009 09:36:15 +0200
Roberto Ierusalimschy <roberto@inf.puc-rio.br> writes:
>> Ok, call me stupid, but a recursive function in my book would be one
>> that can call itself and is self-contained.
>>
>> [...] this is _not_ a self-contained recursive function [...] to get a
>> self-contained recursive function?
>
> If a recursive function should be self contained, why do you need to
> write "self-contained recursive function"? ;)
As a lexical closure. You can always get around those if you avoid
colliding argument names. But being able to reduce something to a level
where you don't even have to think about it is somewhat more satisfying.
--
David Kastrup