lua-users home
lua-l archive

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


2014-08-17 23:53 GMT+02:00 Jan Behrens <jbe-lua-l@public-software-group.org>:

> Still looking forward to feedback.

I don't like it. I don't like Lua 5.3.0-alpha ipairs either.

What you, and Lua 5.3.0-alpha, have been trying to do
is to second-guess what semantics ipairs should have
if a programmer has been tinkering with __len and __index.
And Lua 5.3.0-alpha is so prescriptive about it that the
programmer does not even have the freedom to override
that guess.

I think _any_ iterator that is metatable-aware must either
be very explicitly specified (e.g. by __pairs or __ipairs)
or stashed in the table library, which can have its own tight
well-specified protocol.