lua-users home
lua-l archive

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


On 04/11/2014 08:51 AM, duz wrote:

Unless there are __index methods out there which return multiple
values already and the users are protected from them by Lua throwing
them away, nobody will be caught by surprise and harmed.


As this is a documented feature, and regarding the number of Lua users in world I would expect that just that will happen. Callers will be harmed that are currently protected by Lua.

To sum it up, index metamethods that return multiple values are valid. Expecting the index operator to only return one result is valid. So your suggestion would break totally valid code. It doesn't matter if this code make sense or not, all that matters to me is that this code is valid. Your suggestion breaks backward compatibility. Which is not a no-go per se but I would need good arguments to convince me to make such a change.
--
Thomas