Xref: utzoo comp.object:536 comp.lang.c++:5716 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!apple.com!chewy From: chewy@apple.com (Paul Snively) Newsgroups: comp.object,comp.lang.c++ Subject: Re: Continuations Message-ID: <5524@internal.Apple.COM> Date: 30 Nov 89 18:50:56 GMT Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 32 References:<2664@bingvaxu.cc.binghamton.edu> <9624@pyr.gatech.EDU> <1623@odin.SGI.COM> <1663@odin.SGI.COM> <1419@cs.rit.edu> In article <1419@cs.rit.edu> mjl@cs.rit.edu writes: > What is the essential difference between a continuation in Scheme and > the classic notion of a coroutine? Coroutines have been around for > years (Conway's paper describing them came out in the '60s), and can be > found in Simula-67 (where they are used with the object metaphor to > represent the semi-independent entities in a simulation). The > "processes" of Modula-2 are also ccoroutines. There are several > packages for C that implement "light weight processes", and these are > essentially ccoroutines (I have one available if anyone is > interested). Finally, Stroustrup has a tasking package for C++ which > captures this concept. > > This is not to deny that Scheme may have a more elegant, general,and > formal (and thus less ad-hoc) approach, but I think we have to be alert > enough to recognize essential similarities buried under surface > differences. Have I found such a similarity here? No, but you've come very close. It's trivially easy to implement coroutines using continuations, but they are not the same thing. Explaining why continuations are more general than coroutines is a tad tricky. George Springer and Dan Friedman have a new book out from The MIT Press, "Scheme and the Art of Programming," that devotes an entire chapter to continuations, and a section in that chapter to coroutines. I'd advise looking there for a reasonably full treatment of the subject. __________________________________________________________________________ Just because I work for Apple Computer, Inc. doesn't mean that they believe what I believe or vice-versa. __________________________________________________________________________ C++ -- The language in which only friends can access your private members. __________________________________________________________________________ Brought to you by Super Global Mega Corp .com