Single frame continuations proposal

Kris Zyp kris at
Tue Apr 6 06:04:14 PDT 2010

Hash: SHA1

On 4/5/2010 7:05 PM, Waldemar Horwat wrote:
> David Herman wrote:
>> Your answers keep leaving out the definition of the function
>> that you're calling via `->', which is supposed to be the part
>> that creates the requisite object with `continueWith' etc.
>> Examples don't do much good if they skip the part they were
>> supposed to illustrate!
> I have the same comments as David here.  I don't understand what
> you're trying to do here with the many levels of closures that
> take closures that take closures that take closures that ... ad
> infinitum.  I have yet to see the case that bottoms the whole
> thing out.  The thing that makes your proposals so painful to read
> is that the examples quickly blow up into too much code to figure
> out your intent.

That is kind of the point, continuation passing style quickly becomes
extremely complicated for non-trivial code flows. However, if my
coding examples are poorly organized or unnecessarily complicated, I'd
be glad to change them. Maybe it would help if you translated some
JS1.7 code (I assume you know how JS1.7 generators work), and I could
use that as a basis for my samples. How about:
function foo(){
  var a = bar();
  if(yield a)
    yield hi();

Once again my primary intention is that JS1.7 generators provide the
type of continuations/coroutines support that we want, they just need
a more generalizable API, so they can be used for more than just

- -- 
Kris Zyp
(503) 806-1841
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -

More information about the es-discuss mailing list