Re: [VOTE] Generators

From: Date: Mon, 27 Aug 2012 17:59:47 +0000
Subject: Re: [VOTE] Generators
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-62568@lists.php.net to get a copy of this message
On Sun, Aug 26, 2012 at 10:25 PM, Stas Malyshev <smalyshev@sugarcrm.com> 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

« previous php.internals (#62568) next »