Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40781 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51131 invoked from network); 29 Sep 2008 16:05:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Sep 2008 16:05:53 -0000 Authentication-Results: pb1.pair.com header.from=arvids.godjuks@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=arvids.godjuks@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.92.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: arvids.godjuks@gmail.com X-Host-Fingerprint: 66.249.92.170 ug-out-1314.google.com Received: from [66.249.92.170] ([66.249.92.170:61148] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/A7-36431-FDCF0E84 for ; Mon, 29 Sep 2008 12:05:52 -0400 Received: by ug-out-1314.google.com with SMTP id k3so365662ugf.37 for ; Mon, 29 Sep 2008 09:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=Dx9Qi8PwYYcBnZ87qauPJQxX52Q5YBcBFOTv2O1Tktc=; b=Rtdu+NUTw4atqs02aOG6PwDYP/ID+LtDl9oyBO5QKKjdexYi1uvkQlyRgOljcz2gko 2VAffGYLakBYyPU+ODiAXUirH2QXOIbYQpqwCyyffnPaaUL10Vp+fWnKRG7mNnqNDiP4 f0J5Qg+4Hqtp/Y71Ye86ZP1QZzz6a48vQ2qpU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=SNf8rWrhCY4djT+HHrtWnRIiWYpDnn6yMtkB4cokiPNpyvPahX5gJ8dlVm7jqFkEif ScqqQUnI4WazXsdlLNjbLZEM5yDU+TOw1jPh0tZ3zrNg+NGSNoZFc0DwbtBuTptJEZhK a7cNx0i+K8i4H4B6v9C8T8UtIoJC8NMhjAahw= Received: by 10.67.101.17 with SMTP id d17mr529445ugm.40.1222704348838; Mon, 29 Sep 2008 09:05:48 -0700 (PDT) Received: by 10.67.98.20 with HTTP; Mon, 29 Sep 2008 09:05:48 -0700 (PDT) Message-ID: <9b3df6a50809290905w3ef8bee7jde8f34e0ad1c9ffd@mail.gmail.com> Date: Mon, 29 Sep 2008 19:05:48 +0300 To: "Jordi Boggiano" Cc: internals@lists.php.net In-Reply-To: <4bcbf4710809290743m57acbe96q857fb733f32d0ea8@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_35948_26836897.1222704348826" References: <9E3A4397-3595-42D8-BF73-7F7575B93772@pooteeweet.org> <003501c92037$9512fef0$3ffc1f3e@foxbox> <48DD7E3D.5060708@zend.com> <006701c92039$6245dc20$3ffc1f3e@foxbox> <48DDB24A.7090705@chiaraquartet.net> <81.6B.30545.B4C3ED84@pb1.pair.com> <48DE9455.6020608@chiaraquartet.net> <007801c92176$8fdaaba0$3ffc1f3e@foxbox> <84.E0.53562.C6300E84@pb1.pair.com> <4bcbf4710809290743m57acbe96q857fb733f32d0ea8@mail.gmail.com> Subject: Re: [PHP-DEV] alpha3 From: arvids.godjuks@gmail.com ("Arvids Godjuks") ------=_Part_35948_26836897.1222704348826 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 2008/9/29 Jordi Boggiano > On Mon, Sep 29, 2008 at 12:21 AM, Ryan Panning wrote: > > +1, I second this completely > > > > From someone who *was* using namespaces developing against the 5.3 > branch, > > this is going to happen sooner or later. I found that :: just causes to > many > > questions when used in namespaces. Using :: or -> just for the sake of > > reusing existing tokens is just wrong. I'm in favor of # if it can be > worked > > out. > > +1 as well, but I must say # is not right, it is a very black/filled > character, as in it doesn't visually#separate#words#that#well. Using > the dot would be really nice, but I guess it would break with > something like this : "concat".foo.bar()."baz" so it's not an option. > > Using a single colon might work out ? foo:bar:class::staticFunc() > sounds good to me, but maybe I missed something. > > I also had the idea of using the underscore, even though I guess we > can't go through with this as people _might_ have used double > underscores in their class names, I guess it would work out quite well > with single underscores, for example : > > class Foo_Bar { > public static function callMe() > } > Foo_Bar::callMe(); > > ..would be read as class Bar in namespace Foo, but it would be > transparent to everyone since if you use something with a fully > qualified name you don't need to "use" them, right ? > > Anyway it's just a couple ideas, but please stop holding on to that > double colon. > > -- > Jordi > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > I agree with you totally that :: makes too much trouble - people are trying to fix all issues for a few month's now and every time it results in "we cut $something then it works!" and of course developers as myself start to shout that we don't need namespaces half implemented, because they are useless when. I took part in discussion in two threads by this time: here: solving the namespace conflict issues between function/static method class constant/ns constant AND here: true namespaces, yet another point of view Firstly I also proposed . as a separator, but it has issues with constants: That now results in "hello world!". So if CONST is a namespace and we have constant named the same - a problem occures. Well, that can be worked around - we can check for name collision and give an error, but I think people will shout at that as bad, wy we can't have namespace and constant named equaly? Well, I would live with that perfectly, but something tells me developers will be against this. Other problem is resolution. MYNAMESPACE.Test::print() - what is it? A constant named MYNAMESPACE or a namespace itself? As I understand, during compile time that isn't a problem to resolve whether it is constant or namespace? Ok, we done that. Then we hit SOMETHING witch isn't a constant, not namespace. Ups, what error should we give? Undefined constant or missing namespace? Well, as i think of this - only good solution is Fatal error, but then any forgottent to be set constant will result in fatal error. To me that is good - I woun't forget to define any constants! But as I predict - most will shout that it's too harsh, and they will be right at some point (I myself started with a Pascal, so to me an undefined variable === compile error (Fatal error in PHP terms), so it's natural to me to have a Fatal at this point). So -1 on "." So . is more suitable than ::, but also has it's problems - easier o resolve, but problems. In thouse threads people presented next options for namespace separators: 1). ".." as separator. Well, two symbols, has no side effects, but looks quite strage: namespace A..B::staticMethod(). I don't think it's a good one, so -1. 2). Someone proposed \ as separator. A\B::staticMethod() - Looks crazy, isn't it? And we all know, that \ mostly has special meaning in programming languages as escape character. -1. 3). "#" & Co. A#B::staticMethod() - no side effects, bot looks dirty. -1 from me. 4). ::: or ::::. If ::: makes sence, than that man, who proposed :::: should be joking. ::: - no side effects, just little more to type. A candidate. Neither -1, nor +1. So as prevoius speaker suggested, and I personaly got to conclusion in other thread that ":" is ideal. Short, isn't taken. test(); :phpversion(); ?> Looks great, clearly seen and distinguished from :: . So maybe it is time to stop arguing and maybe use :? Because it finaly comes out as good choise in many threads. Please, think about us - developers! We don't want complicated resoution rules. We don't want half functional namespaces with only classes or without constants, ect. And : is something is natural, because we allready have :: separator for static methods. Easy to understand, handy to use, everybody is happy. Don't you want that? +1 for : from me. P.S. There always will be people, who will be against any suggestions. Because that's phycology. They wana be in center of the attension. Just make a vote thread about : and I think you will get a YES for that. ------=_Part_35948_26836897.1222704348826--