Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41075 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84401 invoked from network); 15 Oct 2008 14:25:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2008 14:25:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=steph@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=steph@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 64.99.136.154 as permitted sender) X-PHP-List-Original-Sender: steph@php.net X-Host-Fingerprint: 64.99.136.154 smtprelay-virgin0154.hostedemail.com Received: from [64.99.136.154] ([64.99.136.154:48773] helo=smtprelay-virgin.hostedemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/30-17660-A5DF5F84 for ; Wed, 15 Oct 2008 10:25:33 -0400 Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay07.hostedemail.com (Postfix) with SMTP id 298FA14A0980; Wed, 15 Oct 2008 14:25:28 +0000 (UTC) X-SpamScore: 1 X-Spam-Summary: 10,1,0,96e09ead78425dc8,691ff1dea13fdf9b,steph@php.net,internals@lists.php.net:auroraeosrose@gmail.com,RULES_HIT:355:379:539:540:541:542:543:567:599:601:946:967:973:988:989:1155:1156:1260:1277:1311:1313:1314:1345:1437:1515:1516:1518:1534:1542:1587:1593:1594:1622:1711:1730:1747:1766:1792:2073:2075:2078:2194:2198:2199:2200:2393:2525:2560:2563:2682:2685:2828:2857:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3354:3622:3740:3743:3865:3866:3867:3868:3869:3870:3871:3872:3874:3876:3877:3934:3936:3938:3941:3944:3947:3950:3953:3956:4250:4321:4470:5007:6114:6261:7653:7679:7875:7903:7974:9025:9108,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:none,DNSBL:none Received: from foxbox (62-31-252-63.cable.ubr07.shef.blueyonder.co.uk [62.31.252.63]) (Authenticated sender: steph.fox) by omf09.hostedemail.com (Postfix) with ESMTP; Wed, 15 Oct 2008 14:25:26 +0000 (UTC) Message-ID: <033d01c92ed2$1e48d7f0$3ffc1f3e@foxbox> To: , "Elizabeth M Smith" References: <696583.1217.qm@web707.biz.mail.mud.yahoo.com> <48F4F7EE.2030609@zend.com> <007b01c92e37$b2952e90$3ffc1f3e@foxbox> <48F4FAF4.50509@zend.com> <00e101c92e3c$d5194b90$3ffc1f3e@foxbox> <48F5075C.2050807@zend.com> <31748C8A-66EA-4A27-9E27-486A4C398F5D@pooteeweet.org> <018401c92e41$ef89b0a0$3ffc1f3e@foxbox> <698DE66518E7CA45812BD18E807866CE021B6406@us-ex1.zend.net> <7f3ed2c30810150506p426a5e84wfea92d3a5d78960c@mail.gmail.com> <1F.01.19544.F55F5F84@pb1.pair.com> Date: Wed, 15 Oct 2008 15:27:11 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-session-marker: 73746570682E666F78 Subject: Re: [PHP-DEV] namespaces and alpha3 From: steph@php.net ("Steph Fox") Hi Elizabeth, > This can be solved in three ways. > > 1. Greg's "leaf" solution > foo::bar->baz(); - namespace foo::bar, function baz > foo->bar::baz(); - namespace foo, static method bar::baz > > Personally I don't like this, get confusing even if we pick some weird > operator like :> > > 2. Don't allow functions or constants in namespaces > > Simplest solution but appears to piss off all the people who have never > actually used the current implementation or hate OO on principle Nope, it's more the case that if we don't allow it we have to either say 'never' or set up an environment whereby functions and constants could be supported at a later date if need be. > 3. Steph's idea - Change the separator (I vote ':::' - easy to do, > similar to what we have already) > foo:::bar:::baz(); - namespace foo:::bar function baz > foo:::bar::baz(); - namespace foo, static method bar::baz > > I like this too, minus the headache of arguing over the namespace > separator (again) - in a perfect world this would be a single colon, but > the ternary issues (people write stupid code, so we have to cater to > them) strikes again. Actually that wasn't what I meant. I meant take Greg's "leaf" solution (huh?) without the ambiguous -> part for namespace elements, and yes I'd prefer : for this too but that's dead in the water. So: foo:::bar->baz(); - namespace foo, namespace element bar->baz(); foo:::bar::baz(); - namespace foo, namespace element bar::baz(); foo:::baz(); - namespace foo, namespace element baz(); foo::bar::baz:::bat->fez(); - nested namespaces foo, bar, baz, namespace element bat->fez(); ::baz(); - global element called within namespaced code Those last two work out fine because :: is a scoping operator, not class-specific (which point it took me a while to get my head around). I think Greg's T_NS_MEMBER was the best idea ever for dealing with this sanely, he just did it so quietly we didn't notice: http://marc.info/?l=php-internals&m=122265715319308&w=2, and read all the way to the end. Taking ns elements and scope as different principles means we never get the 'dots before the eyes' issue that caused ::: to be turned down in the first place. Derick won't like ::baz() though. - Steph