lua-users home
lua-l archive

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


2014-08-15 20:37 GMT+02:00 Jan Behrens <jbe-lua-l@public-software-group.org>:

> My question is now (disregarding any implementation
> issues):
>
> "What shall ipairs be in Lua 5.3?"

The present version (Lua 5.3.0 alpha) is: iterate from 1 to #tbl,
respecting both __len and __index. However, #tbl is evaluated
only once, so you need to know it before you start.

Sorry, the following is somewhat off-topic, and bikeshedding, both
of which I hate :-)

What I am starting to miss more and more in Lua is for the
space just before `do` in a `for` statement to be utilized:

   for k,v in ipairs(tbl) while ok(v) do
   end

and

   for k,v in pairs(tbl) if ok(v) do
   end