|
|
||
|
|
The solution to name spaces in general is to get rid of the
concept of globals entirely, and make it possible to pass a pointer to
the namespace of a chunk or module, requiring that a modifier be used
to refer to all such pointed to namespaces. Any variable created in a
chunk or module would be local by definition. If a variable is declared
as local, then it would not be visible to any other module or chunk. If
you wish to use a local copy of a variable from another chunk or
module, you would precede the reference with a "l." or even the "$".
Now I haven't completely thought this version of the idea out for lua
and am not a sufficient expert in lua to do so. Removing ambiguity is
the goal and there is far too much ambiguity in functional languages
almost by definition. The guy who wrote about doing things for newbies
merely wants to leverage his experience at the expense of the growth
and usefulness of the language. Some will misuse almost any thing, and
some will just ignore something that is biting them on the nose, but
everything that can be done to clarify a language should be done.
Subtlety is not a virtue unless one is consoling another about
something personal. Subtlety in code is hard enough to maintain by the
person who wrote it, much less the poor benighted soul who must
maintain another person's code. Everett L.(Rett) Williams II Vaughan McAlley wrote: On 9 July 2010 10:03, Vadim Peretokin <vperetokin@gmail.com> wrote: |