lua-users home
lua-l archive

Making vars local by default

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


It's starting to become apparent to me that life would be easier if new variables were local by default, instead of global. I'm about to go online and look for a patch to do this -- I know other people have had this issue already -- but if anyone wants to
bounce me a link that would be great.
What I really wanted to say is that it would be great if Lua has a special configuration header, where a bunch of #ifdefs could enable/disable common modifications. Such as the local/global default behavior swap, and the double/integer swap, etc. Something
like:
#define LUA_USE_DOUBLE_NUMBERS 1
#define LUA_DEFAULT_GLOBAL_VARS 1
...
I did something like this for a previous toolkit of mine, and it was very handy, but of course it tends to clutter up the code as people request more and more options. Well,
FWIW, just a thought.
Jason
379

AltStyle によって変換されたページ (->オリジナル) /