Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20587 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46265 invoked by uid 1010); 26 Nov 2005 21:06:32 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 46250 invoked from network); 26 Nov 2005 21:06:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2005 21:06:32 -0000 X-Host-Fingerprint: 68.215.62.134 adsl-215-62-134.mia.bellsouth.net Received: from ([68.215.62.134:15926] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id FE/8C-56276-75EC8834 for ; Sat, 26 Nov 2005 16:06:32 -0500 To: internals@lists.php.net,Greg Beaver Message-ID: <4388CE54.6060606@gmail.com> Date: Sat, 26 Nov 2005 16:06:28 -0500 User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 References: <20.BA.56276.A1BC8834@pb1.pair.com> In-Reply-To: <20.BA.56276.A1BC8834@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 68.215.62.134 Subject: Re: namespace separator ideas From: jrhernandez05@gmail.com (Jessie Hernandez) I personally don't like any of these, but I just thought of this one: "%%". Don't think it'll cause any problems at all, and look at the code: What do you think? ":::" is more intuitive for me, but "%%" is an acceptable alternative... Regards, Jessie Greg Beaver wrote: > Hi all, > > I have only one caveat with the \ separator, which is that it is a > little bit too similar to division with /, and can result in some > confusing code like: > > namespace name1 { > class name2{} > } > define('name1', 1); > define('name2', 2); > > $a = new name1\name2; > $b = name1/name2; > ?> > > The same issue exists with all colon based separators (that sounds bad > when read the wrong way...) because of the ternary operator, and :: with > static classes/methods. > > namespace name1 { > class name2{} > } > define('name1', 1); > define('name2', 2); > // this may be a parse error with the current namespace patch, > // but need not be if we use -> > class name1 > { > const name2 = 1; > } > > $a = new name1:::name2; > $b = name1::name2; // do you see the difference? I get confused > ?> > > What about using the T_OBJECT_OPERATOR? This is a parse error in > existing versions, and also implies some separation. > > namespace name1 { > class name2{} > } > define('name1', 1); > define('name2', 2); > // this may be a parse error with the current namespace patch, > // but need not be if we use -> > class name1 > { > const name2 = 1; > } > > $a = new name1->name2; > $b = name1::name2; > ?> > > I also proposed on IRC using \\ as this is similar to netware driver > separators: > > define('name1', 1); > define('name2', 2); > > $a = new name1\\name2; > $b = name1/name2; > ?> > > However, I know Andrei hated this :). I very much prefer the use of ->, > as this has the same advantage as :: of "rhyming" with current syntax. > > Greg