Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-16 Thread Jussi Vaihia
Good reminder, thanks! Implementation would indeed require support from PHP, say: // magic-method __decorate implies that __construct would return $this->__decorate(func_get_args(), $f); and enforce @ as annotation-syntax class Dec1 { function __decorate($args, $f) { return $f; } }

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-16 Thread Christian Kaps
Am 16.09.2010 18:02, schrieb Matthew Weier O'Phinney: > >> in my mind there is a big mistake when using annotations in PHPDoc comments. > What is the mistake? You don't explain that anywhere in your reply -- you > simply > give code examples of how you feel they should work. > For me the mistake

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-16 Thread Matthew Weier O'Phinney
On 2010-09-15, Christian Kaps wrote: > Am 14.09.2010 22:12, schrieb Stas Malyshev: > > I think we _already_ have metadata in PHP, albeit done through > > phpdocs. So the question is kind of moot :) We should see if it's > > enough for us or we want to add/change/extend it and if so, how. > > in m

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-16 Thread Stas Malyshev
Hi! Could PHP as a language be kept "pure" by first implementing python decorators*, then implement annotations using a purpose-built decorator? No, we can't have python decorators because unlike Python PHP functions and classes aren't first-class objects. In Python, this: @dec2 @dec1 def f

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-16 Thread Rafael Dohms
On Wed, Sep 15, 2010 at 5:27 PM, Arvids Godjuks wrote: > Hi all. > > As a user land developer and active reader (and some times poster) for > a few years now this is the first time I trully don't understand what > the hell are you talking about and what are annotations at all and > what will be th

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-16 Thread Jussi Vaihia
Tangent: Could PHP as a language be kept "pure" by first implementing python decorators*, then implement annotations using a purpose-built decorator? @annotate(PHP-code-goes-here) function framework_call(request) { ... } * http://www.python.org/dev/peps/pep-0318/ -- PHP Internals - PHP Runtime

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-16 Thread Adam Harvey
On 16 September 2010 16:40, Aleksei Sapunov wrote: > Hi, > Yes, you right. But [] are used in arrays definition. If take in to account > that format with @ is more readable? > > Is it a problem to implement it using @ symbol? If we're down to bickering about the finer points of the syntax, can we

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-16 Thread Aleksei Sapunov
Hi, Yes, you right. But [] are used in arrays definition. If take in to account that format with @ is more readable? Is it a problem to implement it using @ symbol? 2010/9/16 Christian Kaps > Hi, > > it's reserved for the error control > operator(http://www.php.net/manual/en/language.operators.

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-16 Thread Christian Kaps
Hi, it's reserved for the error control operator(http://www.php.net/manual/en/language.operators.errorcontrol.php). Greetings, Christian On Thu, 16 Sep 2010 11:26:51 +0300, Aleksei Sapunov wrote: > Hello all, > Only today see that here is very intersting discussion. > I have a question: why was

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-16 Thread Aleksei Sapunov
Hello all, Only today see that here is very intersting discussion. I have a question: why was choosed exactly this format (seems like c#-like, not java-like)? Simply [] is used for arrays. Why not use @ at annotation name? 2010/9/16 Pierre Joye > On Wed, Sep 15, 2010 at 10:27 PM, Arvids Godjuks

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-16 Thread Pierre Joye
On Wed, Sep 15, 2010 at 10:27 PM, Arvids Godjuks wrote: > P.S. Personally I would take the energy boiling in this thread and > throw it at solving the windows biuld and PECL problem. Right now you > can't install PHP 5.2 and apache on a Windows 7 - it just crashes > totally. Where are the bugs r

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-16 Thread Ferenc Kovacs
On Wed, Sep 15, 2010 at 10:27 PM, Arvids Godjuks wrote: > Hi all. > > As a user land developer and active reader (and some times poster) for > a few years now this is the first time I trully don't understand what > the hell are you talking about and what are annotations at all and > what will be t

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Alec
Gustavo's message pretty much expresses exactly how I feel. As an extension, I feel that as long as annotations don't slow down existing non-annotated code (or code using the ridiculous phpdoc parsing), then I see no reason to keep annotations from being added. People argue that the new synta

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Gustavo Lopes
On Wed, 15 Sep 2010 23:00:15 +0100, Stas Malyshev wrote: easy as possible for the sooner. In the case of the annotation, the kids writing their websites won't use them, the learning curve remains unchanged. No, because they look at the framework code and when they see all this {...@#!blah

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Stas Malyshev
Hi! easy as possible for the sooner. In the case of the annotation, the kids writing their websites won't use them, the learning curve remains unchanged. No, because they look at the framework code and when they see all this {...@#!blah($...@blah=blah$^)]} they'd have hard time figuring out w

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Pierre Joye
hi Stas, On Wed, Sep 15, 2010 at 8:27 PM, Stas Malyshev wrote: > PHP is meant for different audience than C# or Java. PHP is an entry-level > language. If you have same learning curve for PHP as they have for Java, > what we are doing here? Just adding $'s to variables? There should be a > diffe

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Arvids Godjuks
Hi all. As a user land developer and active reader (and some times poster) for a few years now this is the first time I trully don't understand what the hell are you talking about and what are annotations at all and what will be the usage of them in the PHP. And for what? Building 2-3 frameworks a

RE: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Jonathan Bond-Caron
On Wed Sep 15 12:17 PM, Guilherme Blanco wrote: > I think meta programming is not and would never be part of comment. > As previously said, docblock means documentation, without any meaning > to parser, entirely human readable and totally removable without > affecting overall execution. I have t

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Gustavo Lopes
On Wed, 15 Sep 2010 07:55:55 +0100, Zeev Suraski wrote: At 08:09 15/09/2010, Stas Malyshev wrote: Phpdocs aren't "user documentation" only, not for a long time (I mean the concept, not the particular application called phpDocumentor, of course). They are being used as metadata in many place

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Stas Malyshev
Hi! However I agree about the syntax issues, but the problem is the total lack of clean roadmap and designs more than features additions like this one. The way we decided the NS separator was typically one of these bad choices, made in a hurry without consensus. I wouldn't call it "in a hurry"

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Chad Fulton
---Original Message----- > From: Guilherme Blanco [mailto:guilhermebla...@gmail.com] > Sent: 15 September 2010 17:18 > To: Lars Schultz > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch > > It's curious that you keep complaining about n

RE: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread James Butler
.com] Sent: 15 September 2010 17:18 To: Lars Schultz Cc: internals@lists.php.net Subject: Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch It's curious that you keep complaining about new syntax and propose a new one at the same time. [Foo] introduces new concept, use /** @Foo */ or /** [Foo

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Guilherme Blanco
It's curious that you keep complaining about new syntax and propose a new one at the same time. [Foo] introduces new concept, use /** @Foo */ or /** [Foo] */ instead. What's the point then? I think meta programming is not and would never be part of comment. As previously said, docblock means doc

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Lars Schultz
listen to this man;) I think he's on to something. I don't see any problem with that aproach and both parties would be satisfied, no? Am 15.09.2010 10:45, schrieb Benjamin Eberlei: Hi Zeev and Stas, I wouldnt mind extending doc block metadata support instead of adding a new syntax. I ag

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Christian Kaps
On Wed, 15 Sep 2010 10:46:45 +0200, Pierre Joye wrote: > The only difference in PHP is the complete lack of clear road map and > the chaotic way of deciding things. Yes, I personally see here a huge problem too. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: ht

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Christian Kaps
On Wed, 15 Sep 2010 10:12:43 +0200, Zeev Suraski wrote: > At 09:37 15/09/2010, Christian Kaps wrote: >>On Tue, 14 Sep 2010 23:09:02 -0700, Stas Malyshev >> wrote: >> >> > Whatever syntax it is, it is definitely new. >> >>Yes, but this should not be an argument against it. So every new >>feature ca

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Pierre Joye
On Wed, Sep 15, 2010 at 10:12 AM, Zeev Suraski wrote: > In terms of language-level features, I don't think it's bad at all if PHP > went into a mode that most of the other mature languages went into - where > syntax changes or introduction of new language level features are pretty > rare.  Out of

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Benjamin Eberlei
Hi Zeev and Stas, I wouldnt mind extending doc block metadata support instead of adding a new syntax. I agree with you that PHP Docs allow metadata and they can be used for that (and some people do, including me), however what the annotation patch + rfc tries to achieve is something going

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Zeev Suraski
At 09:37 15/09/2010, Christian Kaps wrote: On Tue, 14 Sep 2010 23:09:02 -0700, Stas Malyshev wrote: > Whatever syntax it is, it is definitely new. Yes, but this should not be an argument against it. So every new feature can have new syntax or should PHP freeze on the current state!? I can't ho

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Stas Malyshev
Hi! - Annotations are like enum fields, or a function headers. You can only specify these values defined by the annotation. In normal data structures like arrays you can define what you will. This is irrelevant for PHP as it's not compiled. So the check would happen in runtime, how does it ma

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Christian Kaps
On Tue, 14 Sep 2010 23:09:02 -0700, Stas Malyshev wrote: > Whatever syntax it is, it is definitely new. Yes, but this should not be an argument against it. So every new feature can have new syntax or should PHP freeze on the current state!? I can't honestly understand why developer shouldn't un

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-15 Thread Christian Kaps
On Tue, 14 Sep 2010 23:09:02 -0700, Stas Malyshev wrote: > Hi! > >> class User { >> >> [NotNull] >> [Integer] >> public $id; >> >> [NotNull] >> [Regexp('/[a-z]*/i')] >> [MinLength(2)] >> [MaxLength(255)] >> public $name; >> >> [NotNull] >> [Zipcod

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-14 Thread Zeev Suraski
At 08:09 15/09/2010, Stas Malyshev wrote: Phpdocs aren't "user documentation" only, not for a long time (I mean the concept, not the particular application called phpDocumentor, of course). They are being used as metadata in many places. You could argue that's misguided but you can't ignore the

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-14 Thread Stas Malyshev
Hi! I think we have the main issue here, it has absolutely nothing to do with users documentation, as phpdoc does. Yes, they both somehow > 'document' something but still totally unrelated for the goals and > usages. To understand that would help to move forward. Phpdocs aren't "user documenta

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-14 Thread Stas Malyshev
Hi! class User { [NotNull] [Integer] public $id; [NotNull] [Regexp('/[a-z]*/i')] [MinLength(2)] [MaxLength(255)] public $name; [NotNull] [Zipcode] public $zipcode; } I'm not sure I understand - why can't you use normal data structure to

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-14 Thread Christian Kaps
Am 14.09.2010 22:12, schrieb Stas Malyshev: > I think we _already_ have metadata in PHP, albeit done through > phpdocs. So the question is kind of moot :) We should see if it's > enough for us or we want to add/change/extend it and if so, how. > Hi, in my mind there is a big mistake when using a

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-14 Thread Pierre Joye
hi, On Tue, Sep 14, 2010 at 10:12 PM, Stas Malyshev wrote: > I think we _already_ have metadata in PHP, albeit done through phpdocs. So > the question is kind of moot :) We should see if it's enough for us or we > want to add/change/extend it and if so, how. I think we have the main issue here,

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-14 Thread Stas Malyshev
Hi! Last year, I attended to a conference where you (Stas) told that the best way to do a feature request/proposal was by writing a RFC and a patch even if the patch is not perfect. The current implementation may not be perfect but it was never said it was a final one. This is a proposal of a fi

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-14 Thread Pierrick Charron
Hi, Last year, I attended to a conference where you (Stas) told that the best way to do a feature request/proposal was by writing a RFC and a patch even if the patch is not perfect. The current implementation may not be perfect but it was never said it was a final one. This is a proposal of a firs

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-14 Thread Pierre Joye
hi Stas, On Tue, Sep 14, 2010 at 9:01 PM, Stas Malyshev wrote: > Of course not. It couldn't be that your opponents know what they are talking > about, otherwise they'd agree with you :) Come on. Usefullness of > annotations in Java (where they are very different, as the language is) or > C# (whi

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-14 Thread Stas Malyshev
Hi! There are plenty of use cases for that. The main problem I see is that nobody seems to have actually used them in other languages, and then Of course not. It couldn't be that your opponents know what they are talking about, otherwise they'd agree with you :) Come on. Usefullness of annot

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-14 Thread Ferenc Kovacs
On Tue, Sep 14, 2010 at 7:25 PM, Nate Abele wrote: > > > At 17:51 13/09/2010, Gustavo Lopes wrote: > > >> On Mon, 13 Sep 2010 16:28:47 +0100, Zeev Suraski > wrote: > > >> > > >>> At 16:39 13/09/2010, Pierre Joye wrote: > > You are not serioulsy suggesting to use phpdoc for runtime > annotat

Re: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-14 Thread Pierre Joye
hi, On Tue, Sep 14, 2010 at 8:30 PM, Jonathan Bond-Caron wrote: > On Tue Sep 14 01:25 PM, Nate Abele wrote: >> >> Sorry, but I don't see how this is even remotely close to being >> appropriate for PHP. Maybe I'm missing something. :-) >> > > I agree, the use cases are just not there There are pl

RE: [PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-14 Thread Jonathan Bond-Caron
On Tue Sep 14 01:25 PM, Nate Abele wrote: > > Sorry, but I don't see how this is even remotely close to being > appropriate for PHP. Maybe I'm missing something. :-) > I agree, the use cases are just not there Though maybe some form of "annotations" could be useful in php as a "pluggable type"

[PHP-DEV] Re: Re: PHP Annotations RFC + Patch

2010-09-14 Thread Nate Abele
> > At 17:51 13/09/2010, Gustavo Lopes wrote: > >> On Mon, 13 Sep 2010 16:28:47 +0100, Zeev Suraski wrote: > >> > >>> At 16:39 13/09/2010, Pierre Joye wrote: > You are not serioulsy suggesting to use phpdoc for runtime annotation > support? Are you? > >>> > >>> I actually am (either that