[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Implicit Globals - A (better?) compile time solution.
- From: "John Hind" <john.hind@...>
- Date: Tue, 26 Feb 2008 12:13:54 -0000
For the record, and with all due respect to Roberto (which, by the way, is a
lot more than I could ever pay) I agree with Greg Falcon that the proposed
solution (name = name at chunk level) seems inelegant and counter-intuitive.
However, for what it is worth, *I* think a complete solution should comprise
1. Implicit variables should be made local, with function scope to the
inner-most function or chunk (*not* block) enclosing the first assignment
2. To assign (write, including nil) to an environment table global, you
should have to use table syntax (because of 1, this should be a rare thing,
except in libraries).
3. You can continue to *read* the value of a global using implicit syntax,
so libraries etc. are not broken.
4. The 'C' API lua_load (etc.) should have an override parameter to restore
the 5.1 behaviour for hosts that want this (for example, line-by-line
I am retiring hurt now and will probably try these ideas out myself using
patching or syntax mods as suggested by Asko. This debate has gotten way too
theological and confrontational to be either productive or comfortable. For
the record, I never expected changes to be *approved* or *implemented*
easily or quickly, but it ought to be possible to *discuss* and *evaluate*
them rationally without an auto-da-fe!