[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [lua-l] Digest Number 698
- From: Dominik Wagner <dominik-wagner@...>
- Date: Wed, 17 Apr 2002 20:23:31 +0200
On Mittwoch, April 17, 2002, at 06:50 , Edgar Toernig wrote:
Luiz Henrique de Figueiredo wrote:
I'm not sure if the global statement is the right thing.
It's a new thing, and certainly not simple (or at least capable of
in quite complicated ways), but we thing it does address a need. Or
(The only snag right now is the need for "predeclarations".)
It does more. As I see it, people want some kind of protection against
variable names. One fundamental part of that is a way to easily know
globals are exported by a module/file/library. That is not addressed
current global statement (the 'snag' you mention: the core wants to
globals without the need to import each one individually).
The "global" declaration is for sophisticated uses, but I don't think
the language more difficult: it just let's you do complicated scope
And that is what I fear. The simple 'global <name>' is easy and I have
problem with that. A method to let the compiler check for undefined
But the 'global ... in <table>' is something completely different. It
address the mentioned 'need'. It introduces a method for complicated
variable bindings and my fear is that you get even more complex rules
identifier accesses which object?) than the rules in C++. Reading
may become a nightmare.
I aggree. i have a very strange feeling about this global in statement.
What i defininatley don't like is the problem with old and other code
that relies on the "normal" way of globals.
If i use e.g.
global in nil
then any code that is dofiled or something has to obey to this, or it
won't work. quite a mess for any Standard Libraries.
Libraries suddenly depend on how the user wants to handle globals.
That's (as far as i can see now) a bloody mess.
I want to do reusable, as indepent libraries as possible!
And what use is a global-control when you can't use it if you want to
use this or that library or vice versa. Or am i just to blind to see the
simple solution here?
Another thing i don't grasp at the moment is how
global in nil
can be used at all?
after that you have no access to the original functions, or have you?
or do you have to do something like this:
global in nil
and then strfind and print can be used?
In fact, I think that the 'global ... in <table>' has nothing to do
any more. It's a shorthand to access table fields (Pascal's
A completely different topic.
-- http://www.DasGenie.com/ --
AIM: DasGenieDotCom - ICQ: 22369156
"Glück ist eine Verpflichtung. Wir sollten uns für das Glück entscheiden.
Wir sollten daran arbeiten. Und dabei sollten wir denen, die uns am
nächsten stehen, und auch jenen, die nur zufällig unseren Pfad kreuzen,
eine Hilfe sein, damit auch sie ihr Glück finden." - Richard Koch