[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: for loops
- From: lhf@... (Luiz Henrique de Figueiredo)
- Date: Wed, 29 Oct 1997 15:24:15 -0200
>for elt in t do
>This is not the most general 'for' you can think of, but this is what I do
>most of the time: go through a table and look at each element. Sure, you
>can do it using next etc, but this would be much less hassle.
This will be catered for in 3.1 with a new builtin function 'foreach'.
With this, your example will be written
or something like that.
Moreover, 3.1 will bring dynamic function closures so you'll be able to write
foreach(t,function (x) print(x.name) end)