[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How to do actual recursive functions in Lua?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 30 Mar 2009 10:08:54 -0300
> Roberto Ierusalimschy <email@example.com> 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.
I guess I was not clear. I was only teasing you about nomenclature. The
question was not why you want self-contained recursive functions, but
why you have to call them "self-contained recursive functions", since
your definition of "recursive functions" already implied that they should
be self contained ;)
(Obliquely, I was trying to say that self-contained recursive functions
should be a proper subclass of recursive functions, not the same thing...)