[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: globals (_locals)
- From: "Nick Trout" <nick@...>
- Date: Mon, 4 Jun 2001 12:22:57 +0100
>Please keep Lua as simple at it is. This is complicated stuff.
>>It's far worse than that. The problem is identifier scope, not
assignment. To make "a := b" affect other lines where "a = b" is used is
an extremely confusing way of overloading assignment.
Hmm... how about one of the following alternatives:
- all local identifiers must start with an underscore ("_")
- all global identifiers must start with an upper-case letter
I think that way lies madness. :-)
>>I repeat that I do not consider the current scoping an issue. The
"globals.lua" and "undefined.lua" scripts provide ample security IMO.
But if it had to change, I'd vote for "_localname", and eventually
dropping the "local" reserved word.
I dont find the problem that much of an issue either. It wasnt a big issue
in BASIC and it isnt in Python. I'd prefer to see all variables declared
using "local" and "global" I think.
The keyword "global" in Python specifies write access to a global in a
function scope. If you try and read a global thats fine. If you try and
write to one without declaring it global then it will create a new local
with the same name. Dont know if this helps! :-)