[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: for...in usage?
- From: "Albert-Jan Brouwer" <acj.brouwer@...>
- Date: Fri, 4 Oct 2002 10:49:15 +0200
The
for var_1, ..., var_n in explist do block end
syntax is documented to be equivalent to
do
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
block
end
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.
---
Albert-Jan