Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50286 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45711 invoked from network); 17 Nov 2010 06:38:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2010 06:38:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=will.fitch@quepasacorp.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=will.fitch@quepasacorp.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain quepasacorp.com designates 209.85.215.170 as permitted sender) X-PHP-List-Original-Sender: will.fitch@quepasacorp.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:59732] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B5/80-40885-E5873EC4 for ; Wed, 17 Nov 2010 01:38:22 -0500 Received: by eyf5 with SMTP id 5so915851eyf.29 for ; Tue, 16 Nov 2010 22:38:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.11.19 with SMTP id r19mr1560998ebr.81.1289975899178; Tue, 16 Nov 2010 22:38:19 -0800 (PST) Received: by 10.213.104.140 with HTTP; Tue, 16 Nov 2010 22:38:19 -0800 (PST) In-Reply-To: <4CE34E1B.20001@gmail.com> References: <4CE3340F.6090304@sugarcrm.com> <87.0F.25421.F4933EC4@pb1.pair.com> <4CE339DF.1020605@sugarcrm.com> <4CE33D54.8000009@sugarcrm.com> <4CE33F06.3080507@gmail.com> <4CE34E1B.20001@gmail.com> Date: Wed, 17 Nov 2010 00:38:19 -0600 Message-ID: To: Alec Gorge Cc: "guilhermeblanco@gmail.com" , Stas Malyshev , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=00151748e70c3d476a049539eb5c Subject: Re: [PHP-DEV] PHP 5.4 - Meta attribute (aka. Annotations) supportdiscussion From: will.fitch@quepasacorp.com (Will Fitch) --00151748e70c3d476a049539eb5c Content-Type: text/plain; charset=ISO-8859-1 I like the idea, Alec. My only question is, syntactically, what difference would using a keyword, in this case "attribute", as opposed to brackets "[]"? On Tue, Nov 16, 2010 at 9:38 PM, Alec Gorge wrote: > Ah, thanks. > > This is my proposed syntax and examples of it being used: > https://gist.github.com/702925 > > Here is my answer to those questions: > > - PHP code > - See the gist for syntax > - Return object instances of the annotation because then you can call > methods on the annotation if you need to (it think it would be useful) > - Can you APC cache ones that exist at compile time and then not cache ones > that are created at runtime (since they are likely to change anyways, > request to request)? > - Method argument order to maintain consistency with PHP syntax. Named > arguments if PHP ever gets 'em. The grammar addition should use the grammar > already there in the grammar file for calling methods so that it always > works with the new way of calling methods and functions. > - Yes for inherited metadata as long as you can filter it out (exactly like > in the RFC). > > A another comment: > > getAnnotation($name) and getAnnotation($name, $type) both have to become > getAnnotations and then always return an array. This makes things more > consistent and allows for multiple metadata structures for each method. > > The gist I posted would be a fully working API (albeit very basic with no > proper error/exception handling) if the url parsing code was put in, but I > left it out for brevity. > > Opinions? > > -Alec > > > > > On 11/16/2010 9:39 PM, guilhermeblanco@gmail.com wrote: > >> Hi Alec, >> >> Here is the quick list: >> - Where to put the metadata information? docblock or though php code? >> - Syntax (based on first decision) >> - Return would be an array or object instances >> - Compile time or run time (decision is more about APC being able to >> cache, but instances being created at runtime automatically or no APC >> cache but instances only being created when requested (during >> Reflection call) >> - Named variables for instantiation or method arguments order? How >> would we deal with the need of Reflector during constructor if second >> sounds better? >> - Would we support inherited metadata? >> >> Cheers, >> >> On Wed, Nov 17, 2010 at 12:33 AM, Alec Gorge wrote: >> >>> In my opinion (as a person with 0 karma), I think that sounds reasonable >>> because most people are most concerned about the actual implementation >>> (syntax, performance, apc etc) because I don't think many argue that >>> Metadata doesn't have value. >>> >>> What are the 5 different discussion topics you are thinking of, just out >>> of >>> curiosity? >>> >>> Also, I can just post my syntax idea as a gist or pastie or something >>> instead of making an rfc... >>> >>> -Alec >>> >>> On 11/16/2010 9:29 PM, guilhermeblanco@gmail.com wrote: >>> >>>> Hi Stas, >>>> >>>> Ok, so you think I should just consider everyone want some sort of >>>> meta attribute support and start discussing the topics? >>>> Should I separate it in different threads or put it all here? >>>> >>>> The subject is big and I identify at least 5 different discussions >>>> that can diverge. >>>> >>>> Cheers, >>>> >>>> On Wed, Nov 17, 2010 at 12:26 AM, Stas Malyshev >>>> wrote: >>>> >>>>> Hi! >>>>> >>>>> I'm able to write 10 RFC's, but none will care until we reach this >>>>>> list with a patch. >>>>>> >>>>> Not entirely true. Patch helps, but with feature this big and complex >>>>> having >>>>> consensus on design before actually implementing it may be better and >>>>> save >>>>> you some time. >>>>> As for polls, I think generic "having annotations" poll is not very >>>>> useful. >>>>> It's like having a poll "should we have cool features in PHP?" Of >>>>> course >>>>> we >>>>> should! The devil is in the details. And so far the details of this >>>>> thing >>>>> contain a significant number of devils we have to handle. >>>>> -- >>>>> Stanislav Malyshev, Software Architect >>>>> SugarCRM: http://www.sugarcrm.com/ >>>>> (408)454-6900 ext. 227 >>>>> >>>>> >>>> >> >> > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Thanks, Will Fitch Director of Operations | Quepasa.com 931.205.8242 | will.fitch@quepasacorp.com Twitter: twitter.com/willfitch --00151748e70c3d476a049539eb5c--