lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> Having to switch to a new
> assignment operator like ":=" would be much more
> annoying.

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
> directory? 

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!