Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64715 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43628 invoked from network); 9 Jan 2013 05:38:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jan 2013 05:38:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierrick@webstart.fr; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=pierrick@webstart.fr; sender-id=unknown Received-SPF: error (pb1.pair.com: domain webstart.fr from 74.125.82.51 cause and error) X-PHP-List-Original-Sender: pierrick@webstart.fr X-Host-Fingerprint: 74.125.82.51 mail-wg0-f51.google.com Received: from [74.125.82.51] ([74.125.82.51:62756] helo=mail-wg0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/6C-16636-E620DE05 for ; Wed, 09 Jan 2013 00:38:55 -0500 Received: by mail-wg0-f51.google.com with SMTP id gg4so808176wgb.6 for ; Tue, 08 Jan 2013 21:38:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=Cnbm3+VujbiWl63C5v27cZKN72mLPJONLKZN1Xm0P5A=; b=FwDwvOuYh0qzyGhSXYOMRLmHUFowajqvAMoi2cCnmlvqiK4EQ/mc6CljQIw0poFE8w qRzz47qY6NSvisjZxjRz6rI7dESBRz2O3iDUxhwrMlRfGBo6DKPqWXU6babaf0miYoHM Bhcr9olEvE3iD9TuJ4jYlRYsjRvWm9qt92NuLdG4wThNu4yw4aZyJGEfUdiHpoBtg4dB yjpI+0I0Ngj8vTE4pMXBgEG6R6f15f44nqIyT7Tf3OoWa7Ehe/iFnTMteTx3GHbqZjNl ELbVVGE0WZdy7NUJKUYNYiSCwsJ8tZTDjr0+MOIkJ/vTKG34RrUrEizgFyYddLqvX8Lk RzKg== MIME-Version: 1.0 Received: by 10.194.242.69 with SMTP id wo5mr106253645wjc.10.1357709932233; Tue, 08 Jan 2013 21:38:52 -0800 (PST) Received: by 10.180.164.13 with HTTP; Tue, 8 Jan 2013 21:38:52 -0800 (PST) In-Reply-To: References: Date: Wed, 9 Jan 2013 00:38:52 -0500 Message-ID: To: "guilhermeblanco@gmail.com" Cc: Rasmus Schultz , Vladislav Veselinov , PHP internals Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkmrQgUnThylHkQ9P9WHlEwAZiNX8K5DhUGBRMC9EnXkJlrAlm6xvdlDMPfG4qhBJNKkFKj Subject: Re: [PHP-DEV] [RFC] Reflection annotations reader From: pierrick@webstart.fr (Pierrick Charron) Unfortunately [] is still not usable because it will introduce syntax ambiguity with short array syntax. The patch we've done for annotations would require some small change to work on the new master version but I can take some time to do it if I see some interest in the proposal. If someone want to try it how everything would work, a patched version of the old master (from may) can be founded here : https://github.com/adoy/php-src/tree/annotations-v3 (tests are in tests/annotations). Pierrick On 8 January 2013 21:10, guilhermeblanco@gmail.com wrote: > Hi, > > At the time Pierrick and I worked on annotations patch, we couldn't use > some of the operators due to many different reasons: > @ = error supressing > [] = short array syntax > {} = scopr creation > : = all sorts of problems you can imagine > & = array referencing > > We actually found that <> was allowed, so we used this one. > Now that short array syntax has evolved a lot from original patch, maybe [] > is supported again. > > > On Tue, Jan 8, 2013 at 8:08 PM, Rasmus Schultz wrote: > >> I've started working on a new proposal, but I'm getting hung up on the >> syntax - if we can't use angle brackets anymore, what can we use? Virtually >> every symbol on a standard US keyword is an operator of some sort, does >> that mean those are all out of the question? >> >> e.g. thinking of concrete possible basic syntax, neither of the following >> delimiters would work: >> >> [Foo('bar')] >> >> >> >> {Foo('bar')} >> >> And presumably none of the following would work either: >> >> ~Foo('bar') >> @Foo('bar') >> ^Foo('bar') >> *Foo('bar') >> &Foo('bar') >> :Foo('bar') >> >> Can you think of anything that would work? >> >> >> On Tue, Jan 8, 2013 at 3:57 AM, Vladislav Veselinov >> wrote: >> >> > Assume that you have this class with your proposed syntax: >> > >> > [SomeAnnotation('somevalue')] >> > class Test { >> > >> > } >> > >> > This conflicts with the short array syntax. It looks like an array >> > containing the result of the function 'SomeAnnotation' invoked with >> > the parameter 'somevalue'. >> > The only difference is the missing ";" but relying on this to >> > determine whether this is an annotation or not would be insane. >> > I'd support such a decision but with other syntax. >> > >> > I like Guilherme's RFC. I just don't think that the syntax is very >> PHPish. >> > >> > >> > > > > -- > Guilherme Blanco > MSN: guilhermeblanco@hotmail.com > GTalk: guilhermeblanco > Toronto - ON/Canada