Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33900 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93913 invoked by uid 1010); 10 Dec 2007 17:35:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 93898 invoked from network); 10 Dec 2007 17:35:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Dec 2007 17:35:29 -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 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:26452] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0E/29-37002-AD87D574 for ; Mon, 10 Dec 2007 12:35:29 -0500 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 10 Dec 2007 19:35:19 +0200 Received: from [192.168.16.91] ([192.168.16.91]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 10 Dec 2007 09:35:16 -0800 Message-ID: <475D78D4.6050509@zend.com> Date: Mon, 10 Dec 2007 09:35:16 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Martin Alterisio CC: PHP Developers Mailing List References: <52dbac0f0712100837m76aeb9b1o8f2ff666451a73a9@mail.gmail.com> In-Reply-To: <52dbac0f0712100837m76aeb9b1o8f2ff666451a73a9@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Dec 2007 17:35:16.0523 (UTC) FILETIME=[06F6EFB0:01C83B53] Subject: Re: [PHP-DEV] RFC: Arguments (and suggestions) against the current implementation of namespaces From: stas@zend.com (Stanislav Malyshev) > a) Introduce a special name to refer to the current namespace (as self:: > works for the current class). namespace:: > All namespace access should be explicit: Consequence: nobody uses namespaces, as it's too annoying. > b) Name aliasing with use should only generate namespaces aliases: See no reason for that limitation. Used in moderation, class aliasing is OK. Main thing is not to rely on it for everything. > 2) Using :: as namespace separator generates ambiguity Would that be 20th reincarnation of "let's find weirdest namespace separator" thread? :) > ... > Foo::test(); // a member function? a namespaced function? > ?> Sometimes you need context. When you just take $foo->bar() it doesn't give you much - you should know what $foo is and what bar() does. > Why is this an argument against: there was not a construct that works as > this one in PHP. This is not an argument - each construct works as needed for it to work to achieve its purpose. > c) If bracketed namespaces are a no-go, consider the possibility of > declaring the full name of the namespaced element in its definition: Which would lead to people routinely mixing different namespaces inside one file. Bad idea. Also would kill namespaced functions and constants, which would make organizing libraries using those impossible. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com