lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

>>>>> "Luiz" == Luiz Henrique de Figueiredo <> writes:

    Luiz> We'd like your opinion on whether we should add a FOR loop to
    Luiz> Lua:

    Luiz> 1. Do you miss FOR loops?  2. What syntax would you suggest?

Yes, I miss for loops. The syntax that I would find most useful is

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.