lua-users home
lua-l archive

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


2015-01-15 2:28 GMT+02:00 Tom Sutcliffe <tomsci@me.com>:
> In the “changes” section of the 5.3 docs it says:
>
> "The Table library now respects metamethods for setting and getting
> elements.”
>
> I had to read section 2.1 again and run some tests before I figured this
> doesn’t apply to the use (or not) of __eq metamethods on a table’s elements
> when indexing into it, only for the functions in the table library
> respecting __index and __newindex metamethods defined on the tables
> themselves. Can I suggest that for clarity, the above bit has something
> added to it like “note, this does not apply to the use of an element’s __eq
> metamethod when indexing into a table, which still follows the raw equality
> comparison rules described in section 2.1”
>
> Maybe it’s just me, but in my head I was sure that 5.3 no longer used raw
> equality for table indexing, ah well.

Listing the precise two items of a two-item list seems like a particularly
concise and clear way of specifying it. Once one starts listing also
a selection of what is not on the list would raise the awkward question
of what the criteria are for inclusion on the second list.