[Prev][Next][Index][Thread]
Re: Continuations?
In article <3A06FEB9.68B7D2D@jenkon.com>, Bryn Keller <brk@jenkon.com>
wrote:
> Hi folks,
> After poking around Dylan for a while, I can't seem to find any
> mention of continuations, despite Dylan's Scheme-like feel. Have I just
> missed them somewhere? If not, is there something similar? For instance,
> can the condition handler system be bent into a continuation-like shape?
> If the answer to all the above is no, has any thought been given to
> including them in the future?
Dylan doesn't have general call/cc but it does have built-in facilities
that do several of the things that Scheme people use call/cc to build:
block (xyzzy)
...
end
binds xyzzy to an exit procedure in the same sort of way that call/cc
does. You can use it anywhere inside the block to immediately exit and
return a value for the block as a whole. You can store the exit
procedure in variables, and pass it to other functions. The only thing
you *can't* do is use xyzzy() after exiting from the block. Thus you
can't call the same continuation multiple times, and you can't use it to
build threads.
If you want threads, then Dylan is intended to be used with operating
system- or library-provided threads.
-- Bruce
Follow-Ups:
References: