On Mon, Mar 2, 2015 at 1:34 AM, Patrick Schaaf <p...@bof.de> wrote: > > Am 02.03.2015 00:52 schrieb "Daniel Lowrey" <rdlow...@php.net>: > > > > I'd like to initiate discussion on a proposal to implement generator > > delegation via the following new syntax inside generator functions: > > > > yield * <expr> > > > > The Generator Delegation RFC is available here: > > > > https://wiki.php.net/rfc/generator-delegation > > I like the feature. The syntax is awful. What about "yield use (expr)"? No new keywords, somewhat gramatical, and currently invalid syntax, as far as I can tell.
IMO `yield use (expr)` is awful. Let's note here the unhelpful nature of adjectives like "awful" in technical discussions. That said, I have no special attachment to `yield *`. As noted in the RFC, `yield *` is the syntax used in JavaScript generator delegation. I do see value in using common idioms for existing functionality in other languages. However, I also appreciate how the Python variation `yield from` is both immediately readable and perhaps easier to understand. Pending any implementation difficulties I'm indifferent between `yield from` and `yield *`. I think the functionality is the important thing to take away here; the syntax can be whatever folks want it to be.