lua-users home
lua-l archive

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


Regarding the addition of __len, __ipairs and __pairs 5.2: is still
hard to make a mental picture of what table semantics is with these
new virtualization capabilities. In 5.1 you could only virtualize
table indexing, which made for a pretty clear set of use cases, which
pretty much excluded virtualizing collections, i.e. unpack(), #,
table.insert(), etc. would not work. So I wonder what use cases do you
envision for these new metamethods, since even if pairs() and ipairs()
can now be virtualized, other standard functions can't. For instance,
for me, if I know pairs() works for a table, I would expect next() to
work too without having to think much about it.

PS: package.config is a great addition, especially '!' for Windows,
allowing for easy deployment of modules.

PPS: any idea if the iteration protocol could be changed to allow for
nil in the first value without producing massive incompatibilities
with Lua 5.1?