Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31815 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42124 invoked by uid 1010); 21 Aug 2007 21:14:15 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 42109 invoked from network); 21 Aug 2007 21:14:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Aug 2007 21:14:15 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 63.205.162.114 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 63.205.162.114 unknown Windows 2000 SP4, XP SP1 Received: from [63.205.162.114] ([63.205.162.114:10142] helo=us-ex1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/42-28809-5A55BC64 for ; Tue, 21 Aug 2007 17:14:14 -0400 Received: from [127.0.0.1] ([192.168.16.180]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 21 Aug 2007 14:14:11 -0700 Message-ID: <46CB55A0.3050904@zend.com> Date: Tue, 21 Aug 2007 14:14:08 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Gregory Beaver CC: Dmitry Stogov , 'internals Mailing List' References: <46C9F217.8040804@chiaraquartet.net> <000001c7e3cb$9a80b160$6e02a8c0@thinkpad> <46CB3DF1.5090203@chiaraquartet.net> In-Reply-To: <46CB3DF1.5090203@chiaraquartet.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 21 Aug 2007 21:14:11.0000 (UTC) FILETIME=[37DED380:01C7E438] Subject: Re: [PHP-DEV] [PATCH] allowing multiple namespaces per file plus namespaces with brackets From: stas@zend.com (Stanislav Malyshev) > that if you try to "combine" two files that contain import statements, > it will be necessary to expand the imports. Fortunately, since What do you mean by "expand"? > import allows aliasing specific namespaced files and classes within a > file. For example: But import has nothing to do with files. import works on names, not files. > namespace foo { > class bar {} > } > import foo::bar; > namespace gronk { > class bar {} > } > ?> > > Fatal error: Class name 'bar' coflicts with import name Ouch! So I can't actually combine namespaces from different areas - how I'm supposed to know when I write "gronk" that somebody is going to stick this code into the context that already has the name "bar" in it? It's exactly the problem namespaces are meant to solve! Moreover, if you take two files with working code and copy-paste them into one file, they have a lot of chance of stopping working. If this isn't confusion, I don't know what is. > That will clear up any possible confusion. No, on the contrary - it would create a lot of confusion, since now you can break namespaced code with code outside namespace, which wasn't supposed to happen by definition. > Well it kind of makes namespaces behave more like namespaces, don't you Please stop this "only C++ implementation is right" thing. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com