Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62568 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93659 invoked from network); 27 Aug 2012 17:59:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Aug 2012 17:59:53 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:51783] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 41/A6-58395-795BB305 for ; Mon, 27 Aug 2012 13:59:52 -0400 Received: by lahl5 with SMTP id l5so2696140lah.29 for ; Mon, 27 Aug 2012 10:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=BoQolvHcIMXWHKBXl/smsp5lDJzcyUkWcGUO/qIYAUM=; b=GBiIwCSNXbShc0MJtLRiXXOEJs1HmedVFI0os8HvTY6uwFR5p5matW7W6lBOfJXq/b CE0mkKwtfFmwSUJtiMoe2ryVpEiglWH2KS+wRoFuddApToW9H6IVEex3HjmJb8/yo/N7 Kg9Z6hs2mtA9Hx63qB7u2DSk1czHG+nwu+yigP6H5FXpVmiIeJ/NF79/14UG08DWl652 ULnG0JNKinWCyRIaBLNMkGFAPDSwdxndhkNCtSXVk51RtyavCssx7CIFHGURw4PlDZ01 S/63ztEmZdmQt2IKl9Hd+nPE39tM1pljcHROJuJg19kFgsH7jjlUGPdRXc3ZFrT50+3T j4ow== MIME-Version: 1.0 Received: by 10.152.113.68 with SMTP id iw4mr15548269lab.50.1346090387945; Mon, 27 Aug 2012 10:59:47 -0700 (PDT) Received: by 10.152.122.51 with HTTP; Mon, 27 Aug 2012 10:59:47 -0700 (PDT) In-Reply-To: <503A8645.3040609@sugarcrm.com> References: <503A8645.3040609@sugarcrm.com> Date: Mon, 27 Aug 2012 19:59:47 +0200 Message-ID: To: Stas Malyshev Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [VOTE] Generators From: nikita.ppv@gmail.com (Nikita Popov) On Sun, Aug 26, 2012 at 10:25 PM, Stas Malyshev wrote: > Hi! > >> I think the generators RFC has been discussed thoroughly enough by >> now, so I opened the vote: >> >> https://wiki.php.net/rfc/generators#vote > > I think it's fine but I'd still like to put forward a proposal to > reconsider the requirement for parentheses in syntax like this: > > $data = (yield $value); > > I don't see how it's particularly useful in this case, or in any case > except for the array(), in which case one would want to always use > parens to make the code clear, but I don't think we need to make it > mandated everywhere just to cover this one (and pretty rare) case. Is > there a technical reason to do that? Yes, the parens are required for technical reasons. For yield-by-ref I have to distinguish expr_without_variable and variable, which seems to break the precedence handling. So I end up with lots of s/r conflicts. I don't know, maybe I just don't the right trick, but I see no way to support it without parens until we have an AST based parser. If anyone has a solution to this, I would have no problem dropping the requirement. Nikita PS: And yes, we really need an AST based parser :P