No no no. You've all got it all wrong. Except for the
Dans. :)

> Namespaces are going to be *simple*.
> They do two things, and only two things.
> 
> 1) They provide a hierarchy for other namespaces
> 2) They bind names to PMCs

And that's all good. Here's what Perl can do:

$foo becomes namespace['$foo']
::bar becomes namespace[':foo']

Now, if it wants to play nice with other languages
(especially, but not limited to, unified namespace
ones), it can alias either of those values to
namespace['foo']. Otherwise your python programmer has
to say import lib."$foo" or some such.

With this method, the *only* place you'll run into
trouble is in a language where any string can be a
variable identifier. For instance let's say lisp calls
its variables "\0func:foo" and "\0valu:foo", and
someone goes and declares a variable "\0func:hello:)".
Is that variable an aliased-to-the-outside value or
the internal function? (Will this happen often enough
that we care?)

You could solve this by declaring that *all* variables
in a namespace must begin with some sort of sigil, but
then you can't pass a namespace to a function and have
it be treated like a plain ole' associative array (or
at least one with nice keys).

You could also solve the problem by using separate
internal and external namespaces, but that's moving
away from Dan's dictum of 'namespaces are simple'.

Anyhoo. I think the method outlined above is *good
enough for now and likely a long time afterwards*, and
sucks a lot less than making python programmers say
"import Foo.ns.Bar.scalar.baz"


                
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

Reply via email to