Why does Ruby have callcc?

Well, I guess the idea would be that Continuation.current would be the continuation of
whatever line you’re on, or something like that. I agree that it’s not a good way to represent it,
which is why I personally like callcc itself.

···

----- Original Message -----
From: Jim Weirich jweirich@one.net
Date: Friday, August 8, 2003 8:32 am
Subject: Re: Why does Ruby have callcc?

On Fri, 2003-08-08 at 01:42, Dan Doel wrote:

It would read better
if you could do something like:

fun(Continuation.current, arg1, arg2, …)

The problem with this that I see is that Continuation.current implies
the continuation of the currently executing function. For
example, in
the following code …

def f

Stuff

g(Continuation.current)

More Stuff

end

def g(cc)
cc.call
end

The continuation call in g would not return to “More Stuff”, but
to the
function calling f.