Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64786 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3549 invoked from network); 9 Jan 2013 20:28:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jan 2013 20:28:21 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.170 as permitted sender) X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-ob0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:38462] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/A9-02684-4E2DDE05 for ; Wed, 09 Jan 2013 15:28:21 -0500 Received: by mail-ob0-f170.google.com with SMTP id wp18so2668606obc.15 for ; Wed, 09 Jan 2013 12:28:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=D2MwWT2kN9Q4rfMOXQ/OU1H5Ugp/HTv47ukkx3ps2kA=; b=iSTDcyPJkegjyRjvdVZ2JP82G3h1Fk5D0HXSSXdgrXKnEvtUf9WKOQXGtjCv8qOOL8 yZ6UWW7pm9LRuyQBZwPI7B/MvQefRXU3XzG+uAw7PTX7pa0KFBTGeritudvxDAWh1lSf 3sx1U9T9geXp1C2XDM1c+jB/mVMlyDn6DJXuk6N7Fp1TppwbxIIh4nY3/9YsVkNIIPE3 DSO9rqiQZ8V6C3Aprh1ygC/Tbs2Ysgys/D9AKA0AAXOi9Liogug6xOTKWW2Chb7lfmX0 tvaO5xDlADEdfvKOsw+zici+5LssJqiMco7njTA4ogOC2CFKiB8hTZRlmXINQDXVyN9Z nU9A== Received: by 10.60.172.178 with SMTP id bd18mr40824748oec.133.1357763297731; Wed, 09 Jan 2013 12:28:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.174.68 with HTTP; Wed, 9 Jan 2013 12:27:57 -0800 (PST) In-Reply-To: <50EDD202.806@zerocue.com> References: <50EBDEEE.8070605@sugarcrm.com> <50EDA1C5.4040500@sugarcrm.com> <50EDD202.806@zerocue.com> Date: Wed, 9 Jan 2013 15:27:57 -0500 Message-ID: To: Clint Priest Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=bcaec54d49f20ce45004d2e0e7c5 Subject: Re: [PHP-DEV] [RFC] Reflection annotations reader From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") --bcaec54d49f20ce45004d2e0e7c5 Content-Type: text/plain; charset=UTF-8 Clint, If you switch from [] to <> everything works like a charm. =) Everything was working smoothly on version 2. Version 3 was an attempt to simplify the patch, but removing tons of things that would pop in a few time if patch was accepted. Cheers, On Wed, Jan 9, 2013 at 3:24 PM, Clint Priest wrote: > This version of annotations (attributes?) is much more interesting than > the most recent version, but I could see this syntax as being a problem if > it were allowed to apply to plain functions because then the parser would > have difficulty distinguishing from an array. I suppose the same could be > said of applying it to a class. > > In essence though, this prior revision is exactly the kind of thing that I > would be interested in if we could get past the parsing issues... > > > On 1/9/2013 1:57 PM, guilhermeblanco@gmail.com wrote: > >> Pierrick, before update v3 of patch, let's first clarify things that need >> to be discussed. >> Rasmus, you have no idea how happy you made me for a gentle comment >> pointing something we should think before propose a patch instead of on >> (sorry for the wording) bitching about the idea. >> >> There're tons of elements that need to be addressed before working on a >> patch. >> The latest annotations RFC is a small subset of what other languages >> support. To a more complete feature-wise, it is required to go to a >> previous revision: https://wiki.php.net/rfc/**annotations?rev=1302087566 >> >> Some of the elements that needs to be considered: >> >> - Should we support nested annotations? >> >> - How [Foo()] will be different from new Foo()? If they are not different, >> is there an alternative to not bloat lexical parsing? >> >> - How parameters would be injected? Is constructor the only way to inject >> parameters? >> >> - How would we handle optional parameters, like [Foo("bar", null, null, >> "woo")]? >> >> - Suppose you wanna fix the optional arguments by named parameters, like >> [Foo("bar", test="woo")]. Doesn't it diverge with PHP interests of not >> supporting parametrized arguments? Should we modify the former or the >> later? Personally I'm a fan of named parameters. >> >> - How would we deal with inheritance? Should a method, for example, >> inherit >> the same annotations from parent or not? >> >> - Suppose that you define annotations to fix the inheritance problem, how >> would it be? >> >> - How would we cast possible usages of an annotation to only class, method >> or property? Using annotations too? >> >> - How would it be the syntax to declare a new annotation? >> >> - Would it be possible to modify an annotation value using Reflection, for >> example? >> >> - How could it be handled on APC to minimize the performance impact? >> >> >> Let's discuss? Thanks. >> >> >> >> On Wed, Jan 9, 2013 at 2:24 PM, Marco Pivetta wrote: >> >> @Stas we've already come to that, and this is a way to store metadata: >>> the >>> discussion here is just if and how it should get to PHP :) >>> >>> Marco Pivetta >>> >>> http://twitter.com/Ocramius >>> >>> http://ocramius.github.com/ >>> >>> >> >> > -- > -Clint > -- Guilherme Blanco MSN: guilhermeblanco@hotmail.com GTalk: guilhermeblanco Toronto - ON/Canada --bcaec54d49f20ce45004d2e0e7c5--