Re: The generator.next() method

2013-08-23 Thread Forbes Lindesay
It already is dealt with via destructuring assignments: ```js function* gen() { var {x, y, z} = yield [1, 2, 3] return x y || z } var g = gen() var [a, b, c] = g.next().value assert(a === 1) assert(b === 2) assert(c === 3) var res = g.send({x: true, y: false, z: true}).value assert(res ===

Re: The generator.next() method

2013-08-23 Thread André Bargull
`g.next()` returns `{value: [1, 2, 3], done: false}` for me, so .value is needed here. Or do you mean something else? Thanks, André No .value anywhere, though. /be Forbes Lindesay wrote: / It already is dealt with via destructuring assignments: // // ```js // function* gen() { // var

Re: The generator.next() method

2013-08-23 Thread Forbes Lindesay
I just wanted to demonstrate the point, I couldn't remember what the exact API agreed upon for `gen.send` is. On 23 Aug 2013, at 10:07, Andr? Bargull andre.barg...@udo.edumailto:andre.barg...@udo.edu wrote: `g.next()` returns `{value: [1, 2, 3], done: false}` for me, so .value is needed here.

RE: The generator.next() method

2013-08-23 Thread Domenic Denicola
I believe .value is indeed correct, although as André alludes to, .send() has been replaced by .next(). [Working example in Traceur][1] (this is fun!) [1]:

Re: The generator.next() method

2013-08-23 Thread Brendan Eich
Domenic Denicola wrote: [Working example in Traceur][1] (this is fun!) Yes, +lots for Traceur. /be ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: The generator.next() method

2013-08-23 Thread Brendan Eich
André Bargull wrote: `g.next()` returns `{value: [1, 2, 3], done: false}` for me, so .value is needed here. Or do you mean something else? Sorry (to Forbes), I was thinking of when for-of orchestrates. /be Thanks, André No .value anywhere, though. /be Forbes Lindesay wrote: / It

Re: The generator.next() method

2013-08-23 Thread Forbes Lindesay
I'd rather be corrected when I'm right than ignored when I'm wrong, and at the moment I'm still pretty new to the specifics of ES6 APIs :) On 23 Aug 2013, at 19:44, Brendan Eich bren...@mozilla.com wrote: André Bargull wrote: `g.next()` returns `{value: [1, 2, 3], done: false}` for me, so