lua-users home
lua-l archive

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


>     for val in list do
>         print(val)
>     end

While peeking around at the Lua code relating to implementing this, I ran
across a few issues I'd like to see cleaned up for 4.1 (regardless of
implementing the new for form):

    * misnamed functions - Functions related to table iteration are misnamed
using "list" (function forlist etc) in the code.  This for form is clearly
not iterating over a list, and it's going to cause confusion if list
iteration was ever added in the future.  The opcodes are also misnamed
(LFORLOOP etc.) but I suspect changing those would be more headache than
it's worth.

    * "in" allowed as identifier - The parser should give a warning when in
is used as an identifier, so that someday it can be made a "real" keyword
without breaking everyone's code.

-John