Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93311 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85489 invoked from network); 13 May 2016 12:57:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 May 2016 12:57:26 -0000 Authentication-Results: pb1.pair.com header.from=me@daveyshafik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@daveyshafik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daveyshafik.com from 209.85.215.44 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 209.85.215.44 mail-lf0-f44.google.com Received: from [209.85.215.44] ([209.85.215.44:33718] helo=mail-lf0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/72-01216-33FC5375 for ; Fri, 13 May 2016 08:57:24 -0400 Received: by mail-lf0-f44.google.com with SMTP id y84so88179651lfc.0 for ; Fri, 13 May 2016 05:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daveyshafik-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=WH3dDN/OpYjx9DkY/IcRZ+wQcC1TXVnz7K7xXLcIRug=; b=irpouflmC97+Q9E/xGqvto4JapBxXG74cyX6Fmo8V63yHmDoyNCPvORdN1qRbDFXnZ MWHYoeyPwPWqpUuENr+NFbTjcnuT/leiBmr2lfifsryPP3M6xgDzqQDTb/BiLwoOjStV tLBi8PgLu7uavMpyMKJ7vcyy9vQHfxArpkYSyLCns9GLhL3uBjb0f/+PosYyif0aec5n zAca7SjU8CQWmD8LUTs1pB5N/M8WACaYzNkbwy9PJBcUNaJ2H7PdJVBBJ78+USmZdFF8 4OKCU+IN2KQKnzsWCFERtGqjECXQwSlNKVQMIP4Ex8YFXUO+dqtiSwjYbeDzRuIhYxxR 5AMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=WH3dDN/OpYjx9DkY/IcRZ+wQcC1TXVnz7K7xXLcIRug=; b=nEahLRb3hjiRu/DNtmIFwU4T2XFHB80h3kakNOQ4pYoaIs+rlPr5xjxuB9JHynX3Xk YSFj8SBNh2dM+1lKjhpHQl6ealtTwIKcBdXJSqZ3ZrqB530OA7pR3tpgH/WaSB8BV0rt P/h8Q51ubzrtkzpXha3ut+49gR5+M2At9qkWqOWYLxbMUK4VWcvgPZDcS4pjfW5vQiv6 8AsjtK9oTJZ/xvQCaSLilK30/YaQUDDEQeNszLiRLvmTvqP7TEoukfe96ZyFVKd61F/w SnF32hgXceaSlP8/B9FSrQgjWJhvBAqZSOu6vx4galdIw5g8+YEoHvcSZ8DuyxmF2hEa JV0w== X-Gm-Message-State: AOPr4FUjklo9dewcbgwopCh5ODKnyRdaUsitU1lJ49nPbhKeyeM3ld1Xje7wQgehRGbpuYFGFTki4Bj4KYWQq1BQ MIME-Version: 1.0 X-Received: by 10.25.169.82 with SMTP id s79mr6677898lfe.108.1463144240152; Fri, 13 May 2016 05:57:20 -0700 (PDT) Sender: me@daveyshafik.com Received: by 10.25.28.10 with HTTP; Fri, 13 May 2016 05:57:20 -0700 (PDT) In-Reply-To: References: Date: Fri, 13 May 2016 14:57:20 +0200 X-Google-Sender-Auth: ONVoEmItXZYhePOHY9xsApPFOC0 Message-ID: To: Rasmus Schultz Cc: PHP internals Content-Type: multipart/alternative; boundary=001a114106d8b09dc10532b8d075 Subject: Re: [PHP-DEV] [RFC] Simple Annotations From: davey@php.net (Davey Shafik) --001a114106d8b09dc10532b8d075 Content-Type: text/plain; charset=UTF-8 On Fri, May 13, 2016 at 2:11 PM, Rasmus Schultz wrote: > Dear Internals, > > I'm announcing a simplified RFC for annotations: > > https://wiki.php.net/rfc/simple-annotations > > It's an alternative to the proposed Attributes RFC and the (2010) > Annotations RFC. > > I'm attempting with this to describe a feature that is closer to the > language than what is proposed by the Attributes RFC, by permitting > the use of any valid PHP expression as an annotation value. > > Where the Attributes RFC proposes new syntax for what is essentially > arrays, this proposal instead permits you to use actual arrays, e.g. > without inventing any new syntax. It also allows you to use values of > any other type, including objects. This makes the proposed feature > more immediately useful, with a minimal learning curve. > > Compared with the old Annotations RFC (and Doctrine Annotations, etc.) > this proposal does not attempt to define or enforce any rules about > what annotations are, permitted usage, inheritance rules, etc. - > instead it adds a very simple language feature upon which the > community may choose to build (and evolve) facilities that implement > additional rules and logic. > > My hope is that, if we can agree on something very small and simple, > we can defer the more opinionated discussions about rules and logic to > the community. > > In my opinion, language features should be simple, and consistent with > the language - I believe the way to do that, is to avoid discussions > about how such as facility should be used, and instead focus on how it > should work. There is a lot of opinion built into the old Annotations > RFC, and into Doctrine - features that attempt to dictate how the > feature should be used. I don't believe the language should dictate > what is or isn't correct or appropriate use. I think I like this, however a couple of simple questions: 1) Any chance for (optionally) _naming_ annotations? It would be nice to be able to do: ->getAnnotation('table') and not have to handle unnecessary annotations 2) I like the idea of Hacks memoize for example, how do you see those being implemented? Or don't you? 3) When are annotations executed? On ->getAnnotations()? Every time? Thanks, --001a114106d8b09dc10532b8d075--