Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92626 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48435 invoked from network); 22 Apr 2016 02:15:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Apr 2016 02:15:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.217.193 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.217.193 mail-lb0-f193.google.com Received: from [209.85.217.193] ([209.85.217.193:33181] helo=mail-lb0-f193.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 91/0D-14036-B4989175 for ; Thu, 21 Apr 2016 22:15:39 -0400 Received: by mail-lb0-f193.google.com with SMTP id ot1so4259155lbb.0 for ; Thu, 21 Apr 2016 19:15:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=UQmqlYaVZCH49/q5TcVVd+eGBnLoNf9aajR9JOkJwRM=; b=FnJ+KoH8Sf+dRfDbsrQAbhjtua68+hg4laJNbLLE0AFTM2lOjU6bXZbJb7PFZ84gi6 10RGndbiLojUMgSItgiI4A4MB4ZHgHz+dnC5Fhr73wer5BUTQ9d05Mb2TfGycuAKYDqE hFXw68ziEm3EuFVzFvvjFZUBmjFsEI2Mt+FP3aFF+F8cQVy0EDeR/E+oWw5hst63nxuX CzIB2fogqQk92ZoKStQYK51l3O2LjR+XoBiKcYD/UOImvCL9cuif/Lav5PT1Q8cpxHqr E6yzejiGGoc36gXNVOtk5eFEM8iwPU+d5TvSnaPtkchAWmAHAPi4K1OZQGgolHRaQ3ny poHQ== 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=UQmqlYaVZCH49/q5TcVVd+eGBnLoNf9aajR9JOkJwRM=; b=LJ0YuMydXopeCvQsmmfPuFaK4nVASUaQD7wQoe99g7TUKi28FBsP7HBaGBvbpF56lT 0lovAcr5IufF/sU0+jwHDIHMVegYo77UZfIG3vyiMTRZ9udSo4SxfA3Dg/hlff9beWqO 5pabGm1vv5/pNCxU/uB0xgKNfHDS7uWac5WhB17Us5ZopxQ79JsUHXEr6FUaIl5c3qa1 XHYii3vP2iOMC0wI3nh+ouygbkTDCWm0ivgujrVurPd686HeqJZl7A4ehHPfADjhaOCF 7xg4LvTfwD8OOxLMSfslrigsXUj2x8a3vGPtr32lKiVrOMTJ5WP7NL0GvVqfwbsEnNLi yL2Q== X-Gm-Message-State: AOPr4FVzKOgB4NzdNF4u0TIgBFshUIZF4qDAHvdcPXkM4qR9y+8Z1z8iOfgIHdMioJ/XGi14gXgRXUm0GtYp+w== MIME-Version: 1.0 X-Received: by 10.112.198.132 with SMTP id jc4mr7907873lbc.120.1461291335536; Thu, 21 Apr 2016 19:15:35 -0700 (PDT) Sender: php@golemon.com Received: by 10.112.19.74 with HTTP; Thu, 21 Apr 2016 19:15:35 -0700 (PDT) X-Originating-IP: [107.198.91.68] In-Reply-To: References: Date: Thu, 21 Apr 2016 19:15:35 -0700 X-Google-Sender-Auth: fGUG8PcbI4RWXdomXz_eoVKYbNw Message-ID: To: Dmitry Stogov Cc: internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] PHP Attributes From: pollita@php.net (Sara Golemon) On Thu, Apr 21, 2016 at 2:13 PM, Dmitry Stogov wrote: > I would like to present an RFC proposing support for native annotation. > I'm trying to imagine where the benefit of non-constant expressions comes in. <> Assuming we roll in php-ast at the same time (which is a big addition, IMO, and deserves its own separate RFC), what are users meant to do with this? Even if there's a use-case here, one could accomplish the same thing with: <> And manually running that string into php-ast if that's what the caller wanted. Also, maybe I missed it, but I didn't see an answer to the question of ambiguity between parsing the above as a straight string, versus parsing it as a ZEND_AST_ZVAL. I'm sure the answer is "If the AST tree is just a ZVAL, then it's provided as the compile-time expression, but what about something else like this: <> Logically, this is reducible to a single compile-time value, but it's a complex expression, so would it be the value int(2)? Or ZEND_AST_BINARY_OP(int(1), int(1))? I just think that over-engineers what should be a simple annotation feature. All that said, I love the proposal overall, and I can't wait to propose builtin annotations like <<__Memoize>>, <<__Mock>>, and similar. -Sara