[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: setfenv on userdata
- From: Daniel Silverstone <dsilvers@...>
- Date: Wed, 24 Aug 2005 14:29:22 +0100
On Wed, 2005-08-24 at 10:25 -0300, Roberto Ierusalimschy wrote:
> On the other hand, it would be strange to allow nil environments in
> userdata but not in other types. And it would make setfenv/getfenv
> more complex.
On the topic of strange behaviour wrt. environments...
I was more than a little surprised to find that while
GETGLOBAL/SETGLOBAL opcodes use the environment, the lua_getglobal and
lua_setglobal macros use LUA_GLOBALSINDEX rather than LUA_ENVIRONINDEX.
Is this deliberate, should I be using LUA_ENVIRONINDEX explicitly?
Daniel Silverstone http://www.digital-scurf.org/
PGP mail accepted and encouraged. Key Id: 2BC8 4016 2068 7895