Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33745 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96589 invoked by uid 1010); 5 Dec 2007 17:54:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 96573 invoked from network); 5 Dec 2007 17:54:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Dec 2007 17:54:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; 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:44002] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/D8-20707-DD5E6574 for ; Wed, 05 Dec 2007 12:54:38 -0500 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 5 Dec 2007 19:54:35 +0200 Received: from [192.168.16.91] ([192.168.16.91]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 5 Dec 2007 09:54:31 -0800 Message-ID: <4756E5D7.30802@zend.com> Date: Wed, 05 Dec 2007 09:54:31 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Ken Stanley CC: Derick Rethans , PHP Developers Mailing List References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 05 Dec 2007 17:54:31.0712 (UTC) FILETIME=[E3720A00:01C83767] Subject: Re: [PHP-DEV] Namespace From: stas@zend.com (Stanislav Malyshev) > I agree. If the solution to this is to start adding prefixes to the aliased > names, then namespaces lose part of their purpose. The solution is not to import everything in global space. If you must, namespaces as such won't help you avoid collisions. The purpose of namespaces is *NOT* (I don't know how to make it more clear - should I use blinking text, flash graphics and pictures of dancing girls/boys in bikinis?) - it is *NOT* to allow you shoving all your library classes into global space and in some magic way make same names mean different classes by telepathically reading your mind. The purpose of namespaces is to make working with long names - necessary to avoid collisions - easier, by enabling not always use the whole long name but sometimes only a part of it. > Globbing of this nature, in my humbled opinion, would not be the best idea > because of the high potential of problems. But, in the same respect, with That's *exactly* why it was dropped. More precisely, it is one of the reasons - other being it would break lookup performance and bytecode caches. > I think this is a huge issue, if only for consistency with other constructs > of the language. There are already three different ways to write an Guys, really, how many times should we beat this particular dead horse? > The only difference, on the surface, that I see with namespaces vs. standard > prefixing is that namespaces has a new keyword and changes the separator > from an underscore to the double colon. Beyond that, without the other Well, I think reading the actual docs would help to see more. Besides that, namespaces allow aliasing of prefixes and automatic prefixing. > For what it's worth, I would have to completely agree with Derick on this > issue. It just seems that namespaces could be made to do much more than it > already does. Leaving braces aside (please!), what capabilities that were not discussed before do you need? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com