Re: namespaces and alpha3

From: Date: Wed, 15 Oct 2008 18:41:59 +0000
Subject: Re: namespaces and alpha3
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.internals 
Request: Send a blank email to internals+get-41085@lists.php.net to get a copy of this message
Elizabeth M Smith wrote: <snip>
This can be solved in three ways. 1. Greg's "leaf" solution foo::bar->baz(); - namespace foo::bar, function baz foo->bar::baz(); - namespace foo, static method bar::baz Personally I don't like this, get confusing even if we pick some weird operator like :> 2. Don't allow functions or constants in namespaces Simplest solution but appears to piss off all the people who have never actually used the current implementation or hate OO on principle 3. Steph's idea - Change the separator (I vote ':::' - easy to do, similar to what we have already) foo:::bar:::baz(); - namespace foo:::bar function baz
        foo:::bar::baz(); - namespace foo, static method bar::baz
Honestly, either the tough choices must be made soon or namespaces has to be held until 6. IMO From my experience using namespaces #1 AND #2 would make namespaces solid (again IMO). The only thing for #1 is that I wouldn't want to see -> reused, as others have mentioned. Maybe :> or something else. Same for #3, :: just causes confusion. I don't really care what it's changed to, ::: is fine, it just cannot be :: Take a look at what autoload gets when an undeclared namespace, class, whatever is called. That will give you the idea on how autoload doesn't really know what is being called. With the change in #3 and addition of #1, it would be possible to know what is being called. <rant> Seriously, why is changing :: seem like such a problem?

« previous php.internals (#41085) next »