Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31238 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11152 invoked by uid 1010); 24 Jul 2007 13:08:44 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 11094 invoked from network); 24 Jul 2007 13:08:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2007 13:08:43 -0000 Authentication-Results: pb1.pair.com header.from=matthew@teh.ath.cx; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=matthew@teh.ath.cx; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain teh.ath.cx from 139.184.14.87 cause and error) X-PHP-List-Original-Sender: matthew@teh.ath.cx X-Host-Fingerprint: 139.184.14.87 lynndie.uscs.susx.ac.uk Received: from [139.184.14.87] ([139.184.14.87:62587] helo=lynndie.uscs.susx.ac.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DF/1C-07574-4D9F5A64 for ; Tue, 24 Jul 2007 09:08:39 -0400 Received: from cpc1-sout1-0-0-cust1017.sotn.cable.ntl.com ([86.17.55.250]:1796 helo=[192.168.1.105]) by lynndie.uscs.susx.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.64) (envelope-from ) id JLOPU4-000H01-QY; Tue, 24 Jul 2007 14:08:29 +0100 Message-ID: <46A5FA0B.7040708@teh.ath.cx> Date: Tue, 24 Jul 2007 14:09:31 +0100 User-Agent: Thunderbird 2.0a1 (Windows/20060724) MIME-Version: 1.0 To: Rasmus Lerdorf CC: Stanislav Malyshev , Andrew Minerd , 'PHP Internals' References: <46A31D95.2080407@fischer.name> <46A4661A.6080202@zend.com> <200707231140.55535.pstradomski@gmail.com> <46A4BA4F.6090506@dealnews.com> <40CA6572-030F-43E2-8706-64D1167C527C@bitxtender.com> <46A4C090.50402@php.net> <3d1a63d10707230942y2b2504d1p5f995f01d28a622b@mail.gmail.com> <46A4DF33.1030403@zend.com> <20070723110303.0c033048@h4x0r.tss> <46A4EEBA.7040308@zend.com> <46A53A50.1020205@lerdorf.com> In-Reply-To: <46A53A50.1020205@lerdorf.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Sussex: true X-Sussex-transport: remote_smtp Subject: Re: [PHP-DEV] Question about Namespace patch From: matthew@teh.ath.cx (Matthew Kavanagh) Rasmus Lerdorf wrote: > Stanislav Malyshev wrote: > >> Compile-time resolution means you don't get performance penalty for >> namespaces when you are not using it, and have very low costs when you >> do use it. Allowing blanket imports means we don't know what "new Foo()" >> means until it is executed - meaning we need to make extra lookups on >> each class fetch, even if the code doesn't use namespaces at all. That's >> only one problem with blanket imports. >> > > And a fatal one in my book. For the folks arguing so passionately about > this namespace implementation, try to consider the compiler vs. executor > issues involved. We really need to stop the trend of pushing everything > down into the executor. > > -Rasmus > > The compile time vs. execution time argument may be a good one against global import and against other crazy ideas in my head (like allowing statements in namespaces). But why not allow importing namespaced functions and constants into the global namespace? If this were added then "blanket import" could be left to the intrepid and foolhardy programmer to do manually. It'd just end up being boilerplate and if someone really objects to some extra lines they could add an explicit fold in their editor to hide it.