Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31217 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66565 invoked by uid 1010); 23 Jul 2007 17:32:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66549 invoked from network); 23 Jul 2007 17:32:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2007 17:32:23 -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:40890] helo=us-ex1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/1B-27148-526E4A64 for ; Mon, 23 Jul 2007 13:32:23 -0400 Received: from [127.0.0.1] ([192.168.16.180]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 23 Jul 2007 10:32:19 -0700 Message-ID: <46A4E61D.9090101@zend.com> Date: Mon, 23 Jul 2007 10:32:13 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: =?ISO-8859-2?Q?Pawe=B3_Stradomski?= CC: internals@lists.php.net References: <46A31D95.2080407@fischer.name> <200707231643.22562.pstradomski@gmail.com> <46A4D07A.7060006@zend.com> <200707231913.27120.pstradomski@gmail.com> In-Reply-To: <200707231913.27120.pstradomski@gmail.com> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 23 Jul 2007 17:32:19.0587 (UTC) FILETIME=[6BABA530:01C7CD4F] Subject: Re: [PHP-DEV] Question about Namespace patch From: stas@zend.com (Stanislav Malyshev) > Once again. I do not want classes/function from ORM lib to clutter my global > namespace everywhere. I just want everything from it to be available in > couple of files (where lots of SQL/mapping) is going to be used. In those few > files I'll be able to keep control of names and avoid conflicts. > Sure, I can prefix all the names or insert a bunch of imports, although it'll > just be ugly. Maybe if you use a really hairy ORM with a real lot of levels with real lot of namespaces on each level which you all need it might be a bit ugly. It's the same in other languages too - Java and Python code is no stranger to a bunch of imports at the start of the file. And BTW if you have such library structure blanket imports won't help you either since you'd have to do a bunch of imports to capture all the levels. > If using a bunch of imports is the only way that is accepted - then at least a > shortcut like python's "from x import a,b,c,d,e,f,g,h" would be a nice. Supporting comma syntax to group imports is probably a good idea, should hurt anything. As for supporting "from X import A, B, C" - I guess this is to mean "import X::A, X::B, X::C" - we need to think about it. Anyway, there's always an option of just using X::A, X::B and X::C - remember, putting things in global space is not a requirement, prefix is OK. What is not OK is a overly long prefix. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com