lua-users home
lua-l archive

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


On Thu, Apr 10, 2014 at 1:23 PM, Dirk Zoller <duz@sol-3.de> wrote:
> I'd like to rephrase this as a bug report:
>
> Checking the current Lua reference manual, section
>
>     2.4 - Metatables and Metamethods
>
> Nothing in the description of the __index method mentions such
> truncation. The (pseudo?-)Lua code that specifies the semantics
> of "index" just returns
>
>    return (h(table, key))
>
> in the relevant situation which would be
>
>    __index(t,42)
>
> in above example and no truncation of the number of results is
> indicated.

When you place seemingly-redundant parentheses around a function call,
as in this line:

>    return (h(table, key))

...this does indeed truncate the results to one value.

-Duncan