Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50284 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24169 invoked from network); 17 Nov 2010 03:38:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Nov 2010 03:38:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=alecgorge@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=alecgorge@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: alecgorge@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:43512] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/65-25421-C1E43EC4 for ; Tue, 16 Nov 2010 22:38:04 -0500 Received: by yxi11 with SMTP id 11so544086yxi.29 for ; Tue, 16 Nov 2010 19:38:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=7cE84Uobk9YuW0eUGxodBnMoccwPYGpTaU+JbnABCUY=; b=AGj1nZ0xJkk4yBdpKgcdvH+mxdWklwVuY0RqivgKzgqiD2t40pY9MF9/wVfz0ptXrH ub3bddJIVi7acTAuyXs1VWwScvGYJVLN4o+pLE/BgWEzOTViZ4O5SfkdQ1ys4zcMLdI3 W77Yh3HLRS7bPGPGW2kdA5TzIEIkujKCjmEJ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=iYuuJ6lJ3Zj4cvEL/YxQyW29cnvD81Vxtu/SC2zxnuki2g+dm4QDyrFoyNgGF30dbP CQT3f3oOn8Dv9W6qMuv0r9z0dNh9mkXpN3oMNXwvUcHcXt4cpX95Jjc6pLmjeEVmVVUU FQxpPwx/VQ1nIyietJxOBH1+vbnkzxb4XCjLM= Received: by 10.101.1.4 with SMTP id d4mr5932483ani.44.1289965080948; Tue, 16 Nov 2010 19:38:00 -0800 (PST) Received: from [192.168.1.130] (adsl-99-38-57-86.dsl.ipltin.sbcglobal.net [99.38.57.86]) by mx.google.com with ESMTPS id i37sm5837153anh.34.2010.11.16.19.37.59 (version=SSLv3 cipher=RC4-MD5); Tue, 16 Nov 2010 19:38:00 -0800 (PST) Message-ID: <4CE34E1B.20001@gmail.com> Date: Tue, 16 Nov 2010 22:38:03 -0500 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: "guilhermeblanco@gmail.com" CC: Stas Malyshev , "internals@lists.php.net" References: <4CE3340F.6090304@sugarcrm.com> <87.0F.25421.F4933EC4@pb1.pair.com> <4CE339DF.1020605@sugarcrm.com> <4CE33D54.8000009@sugarcrm.com> <4CE33F06.3080507@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP 5.4 - Meta attribute (aka. Annotations) supportdiscussion From: alecgorge@gmail.com (Alec Gorge) 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 >>>> >>> > >