Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-17 Thread Dmitry Stogov
On Tue, Feb 17, 2015 at 4:50 PM, François Laupretre wrote: > HI Dmitry, > > Question : in which scope do you evaluate the PHP expression ? > We don't evaluate expressions. We just store them. Evaluation and/or modification is a subject for future development. > > Example : > > 0);> > 0);> >

RE: [PHP-DEV] Re: Annotations in PHP7

2015-02-17 Thread François Laupretre
HI Dmitry, Question : in which scope do you evaluate the PHP expression ? Example : 0);> 0);> function foo($a) { ... How can you know from this that the first expression must be evaluated at function entry, that the second one must be interpreted when function exits, let alone the question

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Dmitry Stogov
On Tue, Feb 17, 2015 at 6:45 AM, François Laupretre wrote: > Hi Dmitry, > > In my mind, annotation syntax was one level lower, dealing with strings of > unknown syntax, not PHP expressions. Something like : > > '*' '@' STRING free-string-up-to-eol > > This supports : > > * @requires $a > 0 > Th

RE: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread François Laupretre
Hi Dmitry, In my mind, annotation syntax was one level lower, dealing with strings of unknown syntax, not PHP expressions. Something like : '*' '@' STRING free-string-up-to-eol This supports : * @requires $a > 0 But also : * @statement INSERT INTO ?? VALUES (13, 'Phoenix', 'AZ', 33, 112) U

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Rafael Dohms
On Mon, Feb 16, 2015 at 7:41 PM, Dmitry Stogov wrote: > this won't implement features necessary for phpDocumentor, Doctrine, etc. > Just be careful here with phpDocumentor, it does not use annotations but really needs docblocks instead. Today the overlap between it and doctrine and such is just

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Rowan Collins
Dmitry Stogov wrote on 16/02/2015 18:41: this won't implement features necessary for phpDocumentor, Doctrine, etc. I know. Like I say, it's just a way of keeping things moving, rather than saying "eh, maybe next year". It allows us to formally agree the feature, the roadmap, the basic synt

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Dmitry Stogov
this won't implement features necessary for phpDocumentor, Doctrine, etc. On Mon, Feb 16, 2015 at 8:29 PM, Rowan Collins wrote: > On Mon, Feb 16, 2015 at 6:41 PM, Rowan Collins > wrote: > >Is there any value in deciding the initial syntax for 7.0, and >i

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Rowan Collins
On Mon, Feb 16, 2015 at 6:41 PM, Rowan Collins > wrote: Is there any value in deciding the initial syntax for 7.0, and implementing only non-parameterised annotations, i.e. you can call hasAnnotation(string): bool but nothing else? Dmitry Stogov wrote on

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Dmitry Stogov
this will work, of course, and robust implementation wouldn't take more than a day :) but it'll require user-level parser again. no big advantage in comparison to doc-block. Thanks. Dmitry. On Mon, Feb 16, 2015 at 6:41 PM, Rowan Collins wrote: > Nikita Popov wrote on 16/02/2015 12:14: > >> I

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Rowan Collins
Nikita Popov wrote on 16/02/2015 12:14: I think this is a great idea, but we should postpone it to PHP 7.1. Especially if you want to make this AST based (which would require both stabilizing the AST we return for expressions and having APIs to do codegen based on the AST) it will require a lot o

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Cesar Rodas
On 16/02/15 12:36, Dmitry Stogov wrote: > yes. like it was proposed at > https://wiki.php.net/rfc/reflection_doccomment_annotations#list_of_methods_to_implement Awesome. I would +1 for sure! Cheers, > > Thanks. Dmitry. > > On Mon, Feb 16, 2015 at 2:34 PM, Cesar Rodas > w

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Dmitry Stogov
yes. like it was proposed at https://wiki.php.net/rfc/reflection_doccomment_annotations#list_of_methods_to_implement Thanks. Dmitry. On Mon, Feb 16, 2015 at 2:34 PM, Cesar Rodas wrote: > > On 16/02/15 12:32, Dmitry Stogov wrote: > > you already have doc-block. nothing should be done in PHP cor

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Cesar Rodas
On 16/02/15 12:32, Dmitry Stogov wrote: > you already have doc-block. nothing should be done in PHP core, but > you have to parse it yourself. > The goal of annotations is to provide standard and powerful way. > On the other hand standard PHP expression syntax may be not enough for > all cases. A

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Dmitry Stogov
you already have doc-block. nothing should be done in PHP core, but you have to parse it yourself. The goal of annotations is to provide standard and powerful way. On the other hand standard PHP expression syntax may be not enough for all cases. Thanks. Dmitry. On Mon, Feb 16, 2015 at 2:22 PM, Ce

Re: [PHP-DEV] Re: Annotations in PHP7

2015-02-16 Thread Cesar Rodas
On 16/02/15 12:19, Dmitry Stogov wrote: > I decided to explain the proposed annotation syntax "in words" to avoid > misunderstanding > > annotations ::= { annotation }. > annotation ::= '<' STRING '>' | '<' STRING '(' expr ')' '>'. > > where is regular PHP expression. Why not doc-block annotati