lua-users home
lua-l archive

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



On Aug 14, 2014, at 6:07 PM, Jan Behrens <jbe-lua-l@public-software-group.org> wrote:

This is due to the fact that ipairs is a baselib function that utilizes
the iterator triplet construct (which in turn allows us to store only
one state variable, while we would need two state variables here). If
ipairs was a language construct that just behaves like "for i = 1, #t
do local v = t[i]; ... end", then we wouldn't have a problem here.

But that one state variable can contain a table, so you can store as much state as you want.

—Tim