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, guilhermebla...@gmail.com
<guilhermebla...@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 <ras...@mindplay.dk> 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')>
>>
>> {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
>> <v.veseli...@gmail.com>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: guilhermebla...@hotmail.com
> GTalk: guilhermeblanco
> Toronto - ON/Canada

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to