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
[email protected]
https://mail.mozilla.org/listinfo/es-discuss