lua-users home
lua-l archive

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


Yeah thanks Drake I understand now from your explanations.

Sent from my new BlackBerry Z10

From: Drake Wilson
Sent: Thursday, February 14, 2013 9:47 PM
To: Lua mailing list
Reply To: Lua mailing list
Subject: Re: Implementing __index to return nil?

Quoth mlepage@antimeta.com, on 2013-02-14 18:36:20 -0800:
> Awesome info Drake, that's kind of the example I was trying to come up with,
> variable args, but after a few minutes of not getting the results I was
> looking for, I thought I'd ask the experts. :-)

Note that this is still irrelevant in the case of an __index metamethod
specifically! It will apply if you decide to call it manually from Lua
via, say, something_else(getmetatable(t).__index(t, k)), but in the case
where it's being called _as_ a metamethod, the result list is adjusted to
one value to follow the semantics of the [] operator. I was correcting
the notion that function calls in Lua in general have that property. :-)

---> Drake Wilson