[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [proposal] Type metatables per environment
- From: Daurnimator <quae@...>
- Date: Thu, 22 Dec 2011 14:30:21 +1100
On 22 December 2011 12:29, Miles Bader <firstname.lastname@example.org>
Soooo what are the details? How does the compiler implement this?
Patrick Rapin <email@example.com
> My proposal is the following: provided it is possible, why not limit
> the metatable scope to the environment of the current function?
> Even better, I could imagine that the type metatables could be placed
> in the metatable of _ENV and manipulated from there.
How would it impact performance?
Do you mean that, for instance, OP_GETTABLE would need a 4th argument
to pass in _ENV? ... and _every_ indexing operation (maybe the most
common operation in Lua bytecode) would then need to get and pass in
A not too odd assumption to make is that the current environment (ie, _ENV) is always available for a function/VM instruction.