Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31821 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10360 invoked by uid 1010); 22 Aug 2007 00:48:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10344 invoked from network); 22 Aug 2007 00:48:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Aug 2007 00:48:47 -0000 Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 204.127.225.96 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 204.127.225.96 alnrmhc16.comcast.net Solaris 10 1203 Received: from [204.127.225.96] ([204.127.225.96:59211] helo=alnrmhc16.comcast.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 39/20-06291-DE78BC64 for ; Tue, 21 Aug 2007 20:48:46 -0400 Received: from earth.ufp (c-71-228-13-89.hsd1.il.comcast.net[71.228.13.89]) by comcast.net (alnrmhc16) with ESMTP id <20070822004842b1600qimcoe>; Wed, 22 Aug 2007 00:48:42 +0000 Received: from localhost (localhost [127.0.0.1]) by earth.ufp (Postfix) with ESMTP id 3B063D81D7 for ; Tue, 21 Aug 2007 19:48:42 -0500 (CDT) Received: from earth.ufp ([127.0.0.1]) by localhost (earth.ufp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ag4BhfKh42Z2 for ; Tue, 21 Aug 2007 19:48:42 -0500 (CDT) Received: from vulcan.ufp (vulcan.ufp [192.168.42.4]) by earth.ufp (Postfix) with ESMTP id F1C3BD81D6 for ; Tue, 21 Aug 2007 19:48:31 -0500 (CDT) To: internals@lists.php.net Date: Tue, 21 Aug 2007 19:48:30 -0500 User-Agent: KMail/1.9.6 References: <46C9F217.8040804@chiaraquartet.net> <46CB1E05.4090100@zend.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200708211948.30413.larry@garfieldtech.com> Subject: Re: [PHP-DEV] [PATCH] allowing multiple namespaces per file plus namespaces with brackets From: larry@garfieldtech.com (Larry Garfield) 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 larry@garfieldtech.com 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