CRAZY: First class namespaces

Christian Tismer tismer at tismer.com
Mon May 29 06:35:00 EDT 2000


Moshe Zadka wrote:
> 
> On Mon, 29 May 2000, Christian Tismer wrote:
> 
> > What would be better for the language, dynamic or lexical?
> > I really don't know, please tell me your thoughts.
> 
> Definitely lexical.
> I do miss closures...
> Dynamic scopes breaks the abstraction that a function is a "black box": a
> function shouldn't be able to look inside its caller.

Why not? Who said that a function should be a black box?

Lexical scope is one thing to be considered. It is related to
the program text, also has the cyclic reference problems, 
it introduces lookup hierarchies for names. This makes
of course sense to me.

Dynamic scope is about function instances coping with each other.
This is something completely different, and of course I don't
want to use it for automatic name lookup or something.

But I can imagine that one makes sense of it. In comparison to
the __parent__ (which is lexical scope), I would have
a __caller__ property which allows for explicit attribute
access if desired. This is of course a dynamic scope, but
made explicit.

I don't get at the moment why functions should be black boxes.
If you compare this to how classes and instances are
implemented today, you see that these are no black boxes as well.
You can access everything, and not to do so is up to the programmers
decision. I therefore don't see a good reason to forbid
it in the first place if it is easy to implement.

But I'm open for reasoning - ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     where do you want to jump today?   http://www.stackless.com




More information about the Python-list mailing list