Allen Wirfs-Brock (2015-01-31T19:14:31.000Z)
On Jan 31, 2015, at 10:13 AM, Benjamin (Inglor) Gruenbaum wrote:

> I think that people would generally will _expect_ `yield *` to be have like yield inside a loop. So most people would expect:
> 
> ```
> yield* iterator
> ```
> 
> To behave like:
> 
> ```
> for(let val of iterator){
>     yield val;
> }
> 
> ```
> 
> While I'm not (yet) suggesting that the behaviour should be similar in both cases this is definitely something to consider before deciding on throwing or suppressing. 

They are similar, but the transparency requirement of yield* has priority  It's not a pure desugaring.  For example, yield* passes throw the IteratorResu;lt objects produced by the inner iterator.  The above desugaring can't do that.

Allen
d at domenic.me (2015-02-13T23:47:44.942Z)
On Jan 31, 2015, at 10:13 AM, Benjamin (Inglor) Gruenbaum wrote:

> I think that people would generally will _expect_ `yield *` to be have like yield inside a loop. So most people would expect:
> 
> ```
> yield* iterator
> ```
> 
> To behave like:
> 
> ```
> for(let val of iterator){
>     yield val;
> }
> 
> ```
> 
> While I'm not (yet) suggesting that the behaviour should be similar in both cases this is definitely something to consider before deciding on throwing or suppressing. 

They are similar, but the transparency requirement of yield\* has priority  It's not a pure desugaring.  For example, yield\* passes through the IteratorResult objects produced by the inner iterator.  The above desugaring can't do that.