[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [proposal] Libary changes
- From: Philippe Lhoste <PhiLho@...>
- Date: Mon, 10 Oct 2011 07:10:00 +0200
On 09/10/2011 23:12, Sebastien Lai wrote:
Funny you should say that; Infact, one of the reasons I wrote this
proposal is because both 'arg' and '_VERBOSE' are way too often
unknowingly overwritten, because neither '_VERSION' nor 'arg' are in
any way especially marked.
Having these tiny little wee tidbits covered up neatly in a sweet
little 'sys' namespace gets around such problems, and I would not
believe you if you told me you wouldn't think so as well.
"As a convention, names starting with an underscore followed by
uppercase letters (such as _VERSION) are reserved for internal global
variables used by Lua."
A brittle convention, since it isn't enforced by the language, but if
you follow this convention, there is little risk of overwriting them.
arg is the exception to this rule, but it lives only in the command line
interpreter, not in the language itself. And in general, it is parsed at
the start of a script, and no longer used later.
There are still a number of functions living in the global namespace,
but I am happy to be able to type print() instead of System.out.print(),
for example... :-)
-- (near) Paris -- France
-- -- -- -- -- -- -- -- -- -- -- -- -- --