Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40725 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99927 invoked from network); 27 Sep 2008 04:10:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Sep 2008 04:10:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 208.83.222.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 208.83.222.18 unknown Linux 2.6 Received: from [208.83.222.18] ([208.83.222.18:47851] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 98/0D-63390-E42BDD84 for ; Sat, 27 Sep 2008 00:10:55 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id D0C37C0E73F; Fri, 26 Sep 2008 21:09:46 -0700 (MST) Received: from Greg-Beavers-monster.local (c-98-195-66-251.hsd1.tx.comcast.net [98.195.66.251]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 303A8C0E73E; Fri, 26 Sep 2008 21:09:46 -0700 (MST) Message-ID: <48DDB24A.7090705@chiaraquartet.net> Date: Fri, 26 Sep 2008 23:10:50 -0500 User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070807) MIME-Version: 1.0 To: Steph Fox CC: Stanislav Malyshev , PHP Internals References: <9E3A4397-3595-42D8-BF73-7F7575B93772@pooteeweet.org> <003501c92037$9512fef0$3ffc1f3e@foxbox> <48DD7E3D.5060708@zend.com> <006701c92039$6245dc20$3ffc1f3e@foxbox> In-Reply-To: <006701c92039$6245dc20$3ffc1f3e@foxbox> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] alpha3 From: greg@chiaraquartet.net (Greg Beaver) Steph Fox wrote: > Oh Stas, we have to fall out now! > >> Imperfect solution is much better than perpetual absence of any solution. > > See, I'm not sure I agree with that. > > I think 'imperfect but basic solution that can be expanded on' would be > a better approach than trying to do it all in one hit. > > And I still think putting it off to PHP 6 would be a smart move. It's > the major thing that's holding up 5.3. Hi, I have to respectfully disagree with both of you: Stas: choosing an imperfect solution when a better one already exists is just plain stupid, and isn't what you want *or* what you suggested - the solution you, Liz, Marcus and Andi proposed is not imperfect, it is consistent, robust and far better than the existing CVS implementation of namespaces. Don't sell yourself so short! :) Steph: the limited solution proposed by Stas and company (removing functions [and I would add constants]/fixing name resolution) *is* a basic solution that can be expanded on. I outlined the steps in my reply. It's the best solution to the problem, not an imperfect one. A namespace solution that works brilliantly for classes will satisfy at least 2/3 of the users who want it. Adding support for functions, constants and even variables is actually quite do-able with the solution I suggested (different separator between namespace name and function/constant/variable name) and can be added easily. file 1: file 2: myfunc; // separator :> could be anything echo foo::bar:>$myvar; echo foo::bar:>myconst; // all of the below would also be possible, although we may choose not to implement things like use of a variable use foo::bar::myclass, foo::bar:>$myvar, foo::bar:>myfunc(), foo::bar:>myconst, foo::bar; ?> So the question of whether we are making a mistake with Stas's suggestion relayed from ZendCon is debunked by 2 facts: 1) the implementation is a reduced set based on the existing namespace implementation which has been beaten up and tested thoroughly, and because it is simpler, will be even easier to verify its veracity. 2) it can be easily extended to add support later for other components like functions, while preserving 100% BC with the current::implementation. There is also jvlad's suggestion to consider, but in my opinion, this trades one conflict for another, as this code would be a fatal error: Unless we also used my suggestion of having a namespace member separator different from scope resolution operator. In addition, Rasmus has pointed out many times in the past that allowing changing the namespace of external code depending on code load order would simply break opcode caching for PHP. Greg