[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.3 (rc1) now available
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 5 May 2016 10:50:39 -0300
> >> It's certainly a matter of taste, but... isn't calling the example
> >> metatable event "__env" needlessly confusing, given that there is no
> >> actual event called __env and _ENV means something else entirely?
> >
> > Sorry, but what "example" are you talking about?
> >
> > -- Roberto
> >
>
> You can query the metatable of any value using the getmetatable
> function. Lua queries metamethods in metatables using a raw access
> (see rawget). So, to retrieve the metamethod for event env in object
> o, Lua does the equivalent to the following code:
>
> rawget(getmetatable(o) or {}, "__env")
Thanks. (The html has "__<em>env</em>", that's why I could not find
it...)
-- Roberto