[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Globals (more ruminations)
- From: Mark Hamburg <mark@...>
- Date: Fri, 16 Jul 2010 07:33:57 -0700
On Jul 16, 2010, at 5:19 AM, Roberto Ierusalimschy wrote:
>> I'm trying to think when I would use this. Under my normal coding
>> style, I have no real problem with unintentional global sets
>> associated with SETGLOBAL opcodes because I ban SETGLOBAL (plus other
>> things) in my lint checks. Perhaps the only small improvement to this
>> would be some standardized way (e.g. pragma or comment) to assert in
>> source code that "SETGLOBAL opcodes are banned" so that the Lua
>> compiler can bark on it without the complication of running an
>> external tool (which newbie users wouldn't do).
>
> Exactly. (Moreover, 5.2 will not have SETGLOBAL opcodes anymore ;)
Though not having SETGLOBAL opcodes makes it harder to check the code...
For what it's worth, inadvertent global creation has not been a significant problem in Lightroom. Our global check is much more about trying to access functions that don't exist because the name was spelled wrong. So, our tool checks all uses of GETGLOBAL as well against a white list.
Mark
- References:
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Geoff Leyland
- Re: Globals (more ruminations), Alexander Gladysh
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Juri Munkki
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Patrick Donnelly
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Edgar Toernig
- Re: Globals (more ruminations), David Manura
- Re: Globals (more ruminations), Roberto Ierusalimschy