lua-users home
lua-l archive

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


> It has actually become worse in Lua 5. Now, any function which does an
> implicit getn also does a setn (like table.foreachi).

This was "corrected" in the final version. There is no implicit calls
from getn to setn anymore. To traverse sparse arrays, however, you still
need to set its size:

  f = { 1, nil, 10 }
  table.setn(f, 3)

or

  f = { 1, nil, 10 ; n=3 }

-- Roberto