Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93093 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 701 invoked from network); 6 May 2016 02:06:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 May 2016 02:06:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=jesseschalken@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jesseschalken@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.181 as permitted sender) X-PHP-List-Original-Sender: jesseschalken@gmail.com X-Host-Fingerprint: 209.85.223.181 mail-io0-f181.google.com Received: from [209.85.223.181] ([209.85.223.181:35525] helo=mail-io0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/F3-27079-13CFB275 for ; Thu, 05 May 2016 22:06:41 -0400 Received: by mail-io0-f181.google.com with SMTP id d62so102230599iof.2 for ; Thu, 05 May 2016 19:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=iw4gZP/nznR0nib/iErpt+AXUu1oFg0WR00Kon29gN0=; b=MQ2D2lRirbi+C96xuO4kGI+3+PNh/QLmwbqhh7lqKBitGM9kT3UXYsiAY7q5lgueS5 op115lj6VJxuRxamwAGwPTLwtYPeNE/yqqmROz5QWNJZo1RqCX1YAscBvOiIW8sAPkKt xJ7JKDxrT+uavMJ3HLO5nriUm4v0+uHDhra9h9L+8VeASXQhXQYV6LFkqPdZk5dxZzEi LgDs9L4jlZwebxGwZIQGkDzbr+JnkgpsRrIzbdLDKQeYluGOWCt9DmoN8jCmWpTTTh6h yVvqmrpTvjJ9frOdQRddHYyWNhBKDd2NRE/5jQJ9OUgGvkgiaccXs88k61mfaVuKaW9x bhMQ== 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=iw4gZP/nznR0nib/iErpt+AXUu1oFg0WR00Kon29gN0=; b=ajg2aW0cvolNhpzEoZz/idIf66hvFzC6OjjwQNJV607HKhPJPn2VWllEjlpGqpm/qo mpX5BPPJBsvt7+4iqRiYjy7AIV5ZDnLvipRqtYT19/v7iZgJZ6nLA/+ptVKzmz41/0AI wX1RYMqTGHWVAZM5yCk+jPt+TFCk3Prwd04FOPS9mY/I1ljrMGmFff1XqVI5l33L/4/w U10dmNJ4At61ckqamLvJfzYK+DqN6vjbTrLf8yK7iOvLUdrTxi52QJJx+JhKpSzFClOd 7R8MQaygAnfHLyV3KmbFUYwG3xWYSAR/4eDnYxBuxxduYDTgjxUthttQ2u9rUl8BZ7M1 U7FA== X-Gm-Message-State: AOPr4FWJ680Zg0XEe+hv7ln0WIaqhnwcZ/mhFxfvtBpCjk+RJ6FVSZW226a7+MsvRwBhMZuyK6/Rc5sTEGW9rw== MIME-Version: 1.0 X-Received: by 10.107.137.166 with SMTP id t38mr21224243ioi.31.1462500398029; Thu, 05 May 2016 19:06:38 -0700 (PDT) Sender: jesseschalken@gmail.com Received: by 10.79.139.3 with HTTP; Thu, 5 May 2016 19:06:37 -0700 (PDT) In-Reply-To: References: <5723F2AE.2020806@garfieldtech.com> <8a7d1e8a-1e9e-0bbd-912a-21201638b989@gmail.com> <572B5781.4000403@garfieldtech.com> Date: Fri, 6 May 2016 12:06:37 +1000 X-Google-Sender-Auth: vOeFS5TiStzoXqk1WaXX7GJMKNw Message-ID: To: Dan Ackroyd Cc: Larry Garfield , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113ebd80b56a59053222e8ad Subject: Re: [PHP-DEV] Attributes/Annotations Case Study: Drupal From: me@jesseschalken.com (Jesse Schalken) --001a113ebd80b56a59053222e8ad Content-Type: text/plain; charset=UTF-8 If you're going to say "do what you want" with regards to annotations, then just let them be a text string. Parsing the annotation as PHP but not evaluating it as PHP seems a very strange and arbitrary half-way point. If the thing consuming the AST is expected to eval() it, then why didn't PHP do that already? If the thing consuming the AST is expected not to eval() it, then it must effectively implement it's own language sharing PHP's syntax but not PHP's semantics. Since it can't possibly attach meaning to all of PHP's syntax, PHP will enforce that the string is valid PHP even though the annotation language will be a very small subset. Not only does that buy you very little in terms of validity checking, but it constrains the annotation language to be a subset of PHP's syntax even when such a constraint may be entirely inappropriate. A true "do what you want" approach, if that is the right approach, would be for the annotation body to be a free text string. On Fri, May 6, 2016 at 8:36 AM, Dan Ackroyd wrote: > On 5 May 2016 at 15:24, Larry Garfield wrote: > > because it doesn't define "right way". > > Good. > > > I could easily see, for instance, Doctrine annotations building the > > first, PHPUnit the second, and Zend the 3rd. > > Good! > > It's not the job of PHP core to tell people how to use annotations. > People can use them however they want. > > If it turns out that there is a single 'right' way of using them, > everyone will gravitate to that way anyway. > > If it turns out there are different 'right' ways of using them for > different use cases, people will be able to pick and choose the > use-case that is most appropriate. > > And most importantly, if what people think is the 'right' way to use > them evolves over time, that can be accomplished completely in > user-land, without needing to update the internal implementation of > annotations. > > cheers > Dan > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a113ebd80b56a59053222e8ad--