Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-03 Thread Rowan Collins
Niklas Keller wrote on 03/03/2015 12:52: 2015-03-03 13:27 GMT+01:00 Rowan Collins >: Bob Weinand wrote on 03/03/2015 12:08: Why should the word "return" be unique to methods or functions? It just doesn't feel like the same thing as a return valu

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-03 Thread Niklas Keller
2015-03-03 13:27 GMT+01:00 Rowan Collins : > Bob Weinand wrote on 03/03/2015 12:08: > > Am 03.03.2015 um 12:34 schrieb Rowan Collins : >>> >>> Niklas Keller wrote on 03/03/2015 10:55: >>> Gr, top-posting... Sorry, was on mobile. ;-) However, since the existen

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-03 Thread Rowan Collins
Bob Weinand wrote on 03/03/2015 12:08: Am 03.03.2015 um 12:34 schrieb Rowan Collins : Niklas Keller wrote on 03/03/2015 10:55: Gr, top-posting... Sorry, was on mobile. ;-) However, since the existence of the word "yield" is the only thing that marks a coroutine now, how about

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-03 Thread Bob Weinand
> Am 03.03.2015 um 12:34 schrieb Rowan Collins : > > Niklas Keller wrote on 03/03/2015 10:55: >> >>Gr, top-posting... >> >> >> Sorry, was on mobile. ;-) >> >>However, since the existence of the word "yield" is the only thing >>that >>marks a coroutine now, how about using a va

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-03 Thread Niklas Keller
2015-03-03 12:34 GMT+01:00 Rowan Collins : > > Niklas Keller wrote on 03/03/2015 10:55: >> >> Gr, top-posting... > > > Sorry, was on mobile. ;-) > >> However, since the existence of the word "yield" is the only thing that >> marks a coroutine now, how about using a variant of that for the final >>

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-03 Thread Rowan Collins
Niklas Keller wrote on 03/03/2015 10:55: Gr, top-posting... Sorry, was on mobile. ;-) However, since the existence of the word "yield" is the only thing that marks a coroutine now, how about using a variant of that for the final value, e.g. "yield final $foo"? What's the

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-03 Thread Niklas Keller
> > Gr, top-posting... Sorry, was on mobile. ;-) However, since the existence of the word "yield" is the only thing that > marks a coroutine now, how about using a variant of that for the final > value, e.g. "yield final $foo"? What's the final value? The last "yield"ed value or a return? Ju

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-03 Thread Rowan Collins
On 2 March 2015 at 21:24, Daniel Lowrey wrote: > Rowan Collins wrote on 02/03/2015 14:44: > > > Could you explain a bit more about how the generator return > > functionality is necessary for this? It seems to me like it's still just > > a "nice to have", and that the main functionality - delegati

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-02 Thread Daniel Lowrey
Rowan Collins wrote on 02/03/2015 14:44: > Could you explain a bit more about how the generator return > functionality is necessary for this? It seems to me like it's still just > a "nice to have", and that the main functionality - delegating from one > generator to another - is completely separat

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-02 Thread Rowan Collins
Daniel Lowrey wrote on 01/03/2015 23:52: Hi folks, I'd like to initiate discussion on a proposal to implement generator delegation via the following new syntax inside generator functions: yield * The Generator Delegation RFC is available here: https://wiki.php.net/rfc/generator-delegati

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-02 Thread Larry Garfield
Gr, top-posting... On 3/2/15 1:05 PM, Niklas Keller wrote: I prefer yield from, because it yields that value from the generator. Yield use doesn't make any sense to me if I read those words. Additionally, it's already used by another language. Regards, Niklas ^^ Agreed on all points. --Larr

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-02 Thread Niklas Keller
I prefer yield from, because it yields that value from the generator. Yield use doesn't make any sense to me if I read those words. Additionally, it's already used by another language. Regards, Niklas Daniel Lowrey schrieb am Mo., 02.03.2015, 17:13: > From initial discussions it seems prudent

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-02 Thread Daniel Lowrey
>From initial discussions it seems prudent to modify the Generator Delegation RFC to use either of: - yield from - yield use The `yield from` form would add a single T_YIELD_FROM token (as opposed to a new "from" reserved word). The `yield use` form would reuse existing keywords. I'd like t

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-02 Thread Daniel Lowrey
On Mon, Mar 2, 2015 at 1:34 AM, Patrick Schaaf wrote: > > Am 02.03.2015 00:52 schrieb "Daniel Lowrey" : > > > > I'd like to initiate discussion on a proposal to implement generator > > delegation via the following new syntax inside generator functions: > > > > yield * > > > > The Generator De

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-02 Thread Bob Weinand
> Am 02.03.2015 um 11:28 schrieb Niklas Keller : > 2015-03-02 11:11 GMT+01:00 Bob Weinand >: > > Am 02.03.2015 um 01:17 schrieb Niklas Keller > >: > > > > 2015-03-02 0:52 GMT+01:00 Daniel Lowrey > >: > > > >> Hi folks,

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-02 Thread Niklas Keller
2015-03-02 11:11 GMT+01:00 Bob Weinand : > > Am 02.03.2015 um 01:17 schrieb Niklas Keller : > > > > 2015-03-02 0:52 GMT+01:00 Daniel Lowrey : > > > >> Hi folks, > >> > >> I'd like to initiate discussion on a proposal to implement generator > >> delegation via the following new syntax inside genera

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-02 Thread Bob Weinand
> Am 02.03.2015 um 01:17 schrieb Niklas Keller : > > 2015-03-02 0:52 GMT+01:00 Daniel Lowrey : > >> Hi folks, >> >> I'd like to initiate discussion on a proposal to implement generator >> delegation via the following new syntax inside generator functions: >> >>yield * >> >> The Generator

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-02 Thread Craig Duncan
On 2 March 2015 at 00:17, Niklas Keller wrote: > > The proposed syntax has an issue: > > > function a () { > echo yield * 3; > } > > $a = a(); > $a->send(42); > > http://3v4l.org/n1sGb#v550 > > This is currently valid PHP. > > I've created a test for this, so we don't forget it in future ht

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-01 Thread Patrick Schaaf
Am 02.03.2015 00:52 schrieb "Daniel Lowrey" : > > I'd like to initiate discussion on a proposal to implement generator > delegation via the following new syntax inside generator functions: > > yield * > > The Generator Delegation RFC is available here: > > https://wiki.php.net/rfc/generator-de

Re: [PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-01 Thread Niklas Keller
2015-03-02 0:52 GMT+01:00 Daniel Lowrey : > Hi folks, > > I'd like to initiate discussion on a proposal to implement generator > delegation via the following new syntax inside generator functions: > > yield * > > The Generator Delegation RFC is available here: > > https://wiki.php.net/rfc/gen

[PHP-DEV] [RFC Discuss] Generator Delegation

2015-03-01 Thread Daniel Lowrey
Hi folks, I'd like to initiate discussion on a proposal to implement generator delegation via the following new syntax inside generator functions: yield * The Generator Delegation RFC is available here: https://wiki.php.net/rfc/generator-delegation This proposal is conceptually related to