[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: for...in usage?
- From: Philippe Lhoste <PhiLho@...>
- Date: Fri, 4 Oct 2002 09:32:57 +0000 (UTC)
On ven. 04 oct. 2002 10:49:15, "Albert-Jan Brouwer" <email@example.com>
> for var_1, ..., var_n in explist do block end
> syntax is documented to be equivalent to
> local _f, _s, var_1 = explist
> while 1 do
> local var_2, ..., var_n
> var_1, ...., var_n = _f(_s, var_1)
> if var_1 == nil then break end
> I suppose the syntax was chosen with some
> convenient usage scenarios in mind. What
> are they? I have not been able to construct
> one that does not look convoluted.
Well, there was some discussion on this topic some time ago, as I was quite
I finally created a Wiki page to summarize this discussion. http://lua-
Perhaps you will find some more information from there. It is still a bit
artificial, but at least more concrete than the pseudo-code...
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist