Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31222 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95720 invoked by uid 1010); 23 Jul 2007 18:27:58 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 95704 invoked from network); 23 Jul 2007 18:27:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2007 18:27:58 -0000 Authentication-Results: pb1.pair.com header.from=andrew.minerd@sellingsource.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=andrew.minerd@sellingsource.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sellingsource.com from 208.67.190.52 cause and error) X-PHP-List-Original-Sender: andrew.minerd@sellingsource.com X-Host-Fingerprint: 208.67.190.52 mail2.sellingsource.com Received: from [208.67.190.52] ([208.67.190.52:51484] helo=mail2.sellingsource.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/BE-27148-C23F4A64 for ; Mon, 23 Jul 2007 14:27:58 -0400 Received: from localhost (localhost [127.0.0.1]) by mail2.sellingsource.com (Postfix) with ESMTP id 5333548C468; Mon, 23 Jul 2007 11:27:52 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at mail2.sellingsource.com Received: from mail2.sellingsource.com ([127.0.0.1]) by localhost (mail2.sellingsource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G28EPSGWLAYM; Mon, 23 Jul 2007 11:27:51 -0700 (PDT) Received: from h4x0r.tss (unknown [208.67.191.194]) by mail2.sellingsource.com (Postfix) with ESMTP id A30E248C461; Mon, 23 Jul 2007 11:27:51 -0700 (PDT) Date: Mon, 23 Jul 2007 11:28:10 -0700 To: stas@zend.com (Stanislav Malyshev) Cc: 'PHP Internals' Message-ID: <20070723112810.0428efdd@h4x0r.tss> In-Reply-To: <46A4EEBA.7040308@zend.com> 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> Organization: The Selling Source, Inc. X-Mailer: Claws Mail 2.9.1 (GTK+ 2.10.11; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Question about Namespace patch From: andrew.minerd@sellingsource.com (Andrew Minerd) On Mon, 23 Jul 2007 11:08:58 -0700 stas@zend.com (Stanislav Malyshev) wrote: > Exactly - not import everything from namespaces. That's what we are doing :) Well, first of all, not exactly. I think you meant: not import everything from two or more namespaces with conflicting names. Secondly, that's not the only solution. You could import everything from one, and not import from the other (or use a shorter prefix). Thirdly, you're not preventing collisions _at all_: import Zend::DB; import My::DB; import Woot::Database as DB; And what of applications that use libraries without any conflicting names? Let's just be honest about what you're saying: this patch is _intentionally crippled_. > Actually, they can and they do - they use long names which have high > chance to be unique. This works, but this is extremely ugly and > inconvenient to work with. The application does? No: the library does. Currently, an application that is using two libraries with conflicting names can do nothing to resolve the conflicts. With namespace imports (barring a namespace collision), the application chooses how it's going to reference the names within a given library. > Allowing blanket imports means we don't know what "new Foo()" > means until it is executed No: that comes from applying imports at run-time. A "blanket" import could only be applied to classes available at compile time. Granted, that'd be somewhat confusing, but, at the very least, address the proper issue. > That's only one problem with blanket imports. So..... What are the others? Andrew Minerd Software Architect The Selling Source, Inc.