[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Implementing __index to return nil?
- From: Drake Wilson <drake@...>
- Date: Thu, 14 Feb 2013 20:46:44 -0600
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