lua-users home
lua-l archive

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

On Fri, Mar 6, 2020 at 6:16 PM Diego Nehab wrote:
In other words, t[f()] is always a single-index access, even when f() returns multiple values.

IMO, that would make the whole proposal almost useless.

The metamethods can do whatever they want with the '...'. The behavior is the same when there already exists an entry in the table with a single index, but there should never "already exist" a multi-index entry in a table.

Does it mean that
- t[i,j] will always invoke a metamethod,
- it's the programmer's task to save/load multi-index values somewhere by implementing some logic in __index/__newindex?

If that's true, then the whole proposal is absolutely useless.