Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31784 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76843 invoked by uid 1010); 21 Aug 2007 10:23:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 76827 invoked from network); 21 Aug 2007 10:23:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Aug 2007 10:23:39 -0000 Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:48948] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 78/92-54612-82DBAC64 for ; Tue, 21 Aug 2007 06:23:38 -0400 Received: from dhcp-172-30-11-180.zrh.corp.google.com (unknown [216.239.55.7]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id 6F9B71B3641; Tue, 21 Aug 2007 12:23:33 +0200 (CEST) Date: Tue, 21 Aug 2007 12:23:33 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1925889548.20070821122333@marcus-boerger.de> To: "Dmitry Stogov" CC: "'Gregory Beaver'" , "'internals Mailing List'" , "'Stanislav Malyshev'" In-Reply-To: <000001c7e3cb$9a80b160$6e02a8c0@thinkpad> References: <46C9F217.8040804@chiaraquartet.net> <000001c7e3cb$9a80b160$6e02a8c0@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] allowing multiple namespaces per file plus namespaces with brackets From: helly@php.net (Marcus Boerger) Hello Dmitry, LOL!!!!! climbing up the chair again, this is the most stupiest arguemnt ever. didn't you just yesterday suggest we keep it namespace anyway until we are done. And didn't you guys say that we might end up with something that really is namespaces anyway. Please guyse read your own arguments if you do not manage to remember them. marcus Tuesday, August 21, 2007, 10:16:39 AM, you wrote: > How about "import" statements? > The had effect on current file. How they will behave with your patch? > The import in one namespace will affect following namespaces... :) > Also this change is inconsistent with renaming "namespace" to "package". > Thanks. Dmitry. >> -----Original Message----- >> From: Gregory Beaver [mailto:greg@chiaraquartet.net] >> Sent: Monday, August 20, 2007 11:57 PM >> To: internals Mailing List; Dmitry Stogov; Stanislav Malyshev >> Subject: [PHP-DEV] [PATCH] allowing multiple namespaces per >> file plus namespaces with brackets >> >> >> Hi all, >> >> This patch is also available at >> http://pear.php.net/~greg/namespace.patch.txt >> >> The patch adds the syntax "namespace { *stuff }" and allows >> multiple namespaces per file with no performance penalty or >> added complexity as only 4 lines of code need to be changed, >> and 9 lines of code added to implement this support! >> >> Basically, there is one use case of multiple namespaces per >> file that the patch is designed to support, which is the >> ability to cram many files into a single file. I have done >> this for purposes of distributing things (prior to phar), it >> is used by some with phing tasks for performance reasons, and >> can have other uses as well. >> >> The patch provides the ability to do this, for example: >> >> > namespace One { >> require_once 'blah.php'; >> class MyClass extends blah >> { >> function test() >> { >> echo "OK\n"; >> } >> } >> function test() >> { >> echo "OK\n"; >> } >> } >> >> namespace Two { >> class MyClass >> { >> function test() >> { >> echo "OK\n"; >> } >> } >> function test() >> { >> echo "OK\n"; >> } >> } >> ?> >> >> Note that the old format "namespace OneRingToRuleThemAll;" is >> still fully supported, and should be the recommended format, >> as build tools can easily take an entire file, change >> namespace .*; into namespace .*{ and append to the >> end of the file. >> >> The attached patch is against php6, but as you can see, a >> blind monkey could port it to PHP_5_3 when the time comes. >> All of the introduced changes are now tested, including the >> error message for nested namespace declarations, and the >> error message for multiple namespace declarations with ; >> (which was previously untested by .phpt tests) >> >> Thanks, >> Greg >> Best regards, Marcus