Jeremy Martin (2013-07-15T19:49:31.000Z)
> That means CPS transforming functions based on whether they call a
yielding function.

Well, yes :)  Admittedly, that does seem messy.  Not to sound defeatist,
but I'm sensing that I don't actually have the necessary knowledge to
further argue this.  I'll just end with saying that it'll be unfortunate if
we're going to have to endure the clunkiness of nested generators anywhere
higher-order functions are called for.  Regardless of whatever solutions
may or may not be appropriate, I at a minimum echo Claus' sentiment - it
seems like there's a nice opportunity here to improve the modeling of
control structures.

On Mon, Jul 15, 2013 at 3:01 PM, Brandon Benvie <bbenvie at mozilla.com> wrote:

> On 7/15/2013 10:24 AM, Jeremy Martin wrote:
>
>> Correct me if I'm wrong, but wouldn't the lexical-scoping restraint
>> satisfy the shallow generator requirement?  As I understand it, the issue
>> with deep generators and CPS transformations is that the transformations
>> have to be applied to functions that aren't even lexically inside the
>> GeneratorFunction.  Additionally, can't the nested CPS transformations
>> issue by alleviated with a reference to the GeneratorFunction stack frame
>> itself (a la SpiderMonkey)?
>>
>
> Consider the following:
>
>       function* yieldEach(array){
>         array.forEach(n => {
>           yield n;
>         });
>       }
>
> In order for this to work, not only does `yieldEach` have to be suspended
> for the inner yield, but forEach does as well. That means CPS transforming
> functions based on whether they call a yielding function.
>
> ______________________________**_________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss>
>



-- 
Jeremy Martin
661.312.3853
http://devsmash.com
@jmar777
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130715/83145b9e/attachment.html>
forbes at lindesay.co.uk (2013-07-16T18:54:49.546Z)
> That means CPS transforming functions based on whether they call a yielding function.

Well, yes :)  Admittedly, that does seem messy.  Not to sound defeatist,
but I'm sensing that I don't actually have the necessary knowledge to
further argue this.  I'll just end with saying that it'll be unfortunate if
we're going to have to endure the clunkiness of nested generators anywhere
higher-order functions are called for.  Regardless of whatever solutions
may or may not be appropriate, I at a minimum echo Claus' sentiment - it
seems like there's a nice opportunity here to improve the modeling of
control structures.