Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31632 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88533 invoked by uid 1010); 16 Aug 2007 17:13:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 88518 invoked from network); 16 Aug 2007 17:13:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Aug 2007 17:13:52 -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:30928] helo=us-ex1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/10-21499-EC584C64 for ; Thu, 16 Aug 2007 13:13:51 -0400 Received: from [127.0.0.1] ([192.168.16.180]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 16 Aug 2007 10:13:48 -0700 Message-ID: <46C485C9.7000507@zend.com> Date: Thu, 16 Aug 2007 10:13:45 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Guilherme Blanco CC: Marc Gear , Sebastian Bergmann , internals@lists.php.net References: <46BE14B1.5050209@zend.com> <101178402.20070814174515@marcus-boerger.de> <6094eac50708150709o6d1fe42bx3449af2bc1b7f54d@mail.gmail.com> <46C337F4.5080001@zend.com> <6094eac50708160540w4828a72aka2264dc69c69903@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 16 Aug 2007 17:13:48.0124 (UTC) FILETIME=[CF19D9C0:01C7E028] Subject: Re: [Fwd: Re: [PHP-DEV] Renaming namespaces to packages] From: stas@zend.com (Stanislav Malyshev) > Read the purpose of both, which restrictions/limitations both have, > how are they defined, how are they used, etc and you'll see if the > current implementation is more like 'namespace' or 'package'. It's not > related to package Java, namespace C, def, zendspace of whatever. That's what I am trying to explain for a week now and still failing. Namespace as a concept is not the same as implementation of namespaces in C++ or Java. Packages as a concept is not the same as implementation of packages in Java, Perl, C or PHP. PHP is neither C++ not Java. Choosing which language to mimic - Java or C++ - is not the right way to think about the problem. PHP is separate language, not C++ or Java. Just because C++ has + and PHP has + doesn't mean PHP should have operator overloading. Just because PHP has multi-component names and Java has multi-component names doesn't mean namespace definition operator should be the same keyword. That's what I'm trying to explain - the choice is not "should we be like C++ or like Java". We may end up being like it - or not, but it is not the choice we have. > - Allow nested definitions namespace N1 { namespace SubN1 { ... } > namespace Sub2N1 { ... } } That most probably won't happen ever. If you want to know why, look up the nested class saga. In short - too much trouble to implement consistently, too bad runtime performance (unlimited lookup depth at runtime). > not in packages). You tell me 'namespace' are unique. I agree, but > 3rdparty libraries using the name namespace alias will still mess the > entire application. So let's follow bjori (IRC) idea and create the > "filescope"! I'm afraid I don't understand - what would filescope do? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com