[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: proposal (RE: Making vars local by default)
- From: Tom _ <tom7ca@...>
- Date: Thu, 31 May 2001 21:41:27 -0700 (PDT)
> Having to switch to a new
> assignment operator like ":=" would be much more
I'm not suggesting switching. I'm suggesting
adding the ":=" operator (and possibly a "global"
keyword for use with ":=" that does not otherwise
interact with "="; see my other posting).
Nobody who doesn't want to would have to switch to
using ":=". Code that uses "=" would continue to
work and seamlessly work with code that uses ":=".
"x := y" would simply be a shorthand for "put
'local x' at the beginning of the function and
write 'x = y'".
> Have you looked at "globals.lua" in the ./lua/test
Trouble is that in a big program, there may be
both lots of legitimate global variable accesses
and a few spurious ones. I would prefer to be
able to adopt a programming style in which I can
avoid those problems completely.
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/