On Tuesday 21 August 2007, Guilherme Blanco wrote:

> Also, mentioning the Rasmus piece of code:
>
> foo.inc:
> namespace A {
>  include 'bar.inc';
> }
>
>
> bar.inc:
> namespace B {
>  ...
> }
>
> I don't know how do you control it internally, but as long as this is
> the only call in the entire script, the right scope should be: A::B,
> and not B. If I include bar.inc outside any namespace scope, then it
> should be B.

I have to disagree here.  If I'm doing conditional includes (I know opcode 
caches don't like it, but any modular, plugin-based system rather has to), 
then I don't want to have the namespace of my included code vary depending on 
where I include it.  That means that I need to force all of my include 
statements to be outside of a namespace unless I want namespaces to stack, 
and stack differently depending on where they get called.  That's a huge can 
of worms I really don't want to deal with.

Were the code above to be run, I'd expect and want a namespace A and a 
namespace B, and that's it.  My code ends up being too non-deterministic 
otherwise.  Forget the compiler, I can't cope with that. :-)

-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to