[comp.lang.scheme] what do you use continuations for?

oliver@karakorum.berkeley.edu (Oliver Sharp) (02/16/91)

I have a question for the group: what do you use cwcc for?  I taught
a course out of Abelson & Sussman and, among other digressions,
introduced the notion of an explicit continuation.  The first question
everyone asks after getting some grip on what's going on is: so what
is this useful for?  Here are some answers that I've used:
  - you can freeze a big complicated recursively nested computation
      and stash it somewhere, so you can continue it later
  - it's easy to write coroutines
  - you can implement catch-throw very inefficiently

But I have to confess that I've never actually used cwcc in a real
program that was trying to get something done.  Have you?  What for?

Just curious ...
- Oliver

P.S.  I certainly found CPS to be a very handy way to analyze Scheme
code while putting together a Scheme compiler, but that's different.

kadie@cs.uiuc.edu (Carl M. Kadie) (02/16/91)

In <11173@pasteur.Berkeley.EDU> oliver@karakorum.berkeley.edu (Oliver Sharp) writes:

>I have a question for the group: what do you use cwcc for?
[...]

Here is what I would like to use them for:

One of the fun things to do with Lisp is to modify it to have
the features of other languages. For example, rewriting can
be added, pattern matching, functional programming, object-oriented
programming, etc. The great thing about lisp is that after the
extensions are added they become an (almost) seamless part of the
language.

But what if you want to add nondeterminism/backtracking? With
continuations it is easy. Without continuations, the addition
of backtracking is very ugly.

[I want backtracking because many algorithms, especially
those that search, can be written very concisely if
nondeterminism is allowed]

--
Carl Kadie -- kadie@cs.uiuc.edu -- University of Illinois at Urbana-Champaign

acha@CS.CMU.EDU (Anurag Acharya) (02/17/91)

In article <11173@pasteur.Berkeley.EDU> oliver@karakorum.berkeley.edu (Oliver Sharp) writes:
   I have a question for the group: what do you use cwcc for?  

Continuations have been used to implement concurrent constructs like 
threads, co-routines, monitors etc.

Greg Morrisett and Eric Cooper at Carnegie Mellon are working on augmenting
Standard ML with mechanisms for concurrency. The basic primitives of their 
system are SML threads and these are implemented entirely within the 
runtime system using user-level continuations (aka call/cc).
This work has been reported in the following technical report:

"Adding Threads to Standard ML" -- Greg Morrisett and Eric Cooper,
CMU-CS-90-186

For more information send mail to jgmorris@cs.cmu.edu or ecc@cs.cmu.edu

anurag

km219092@longs.LANCE.ColoState.EDU (Kevin Jay Marshall) (02/20/91)

Hello,

	I am wondering if anyone knows where I can get a compete version 
of MIT-scheme dist-7.0 or better yet dist-7.1.  I checked a few ftp-sites
to see if I could find them and could not find a site with the complete
version.  One of the sites that I checked was mcsun.eu.net and another
place was in Zurich.  These had all the tar files, but did not include
the microcode directory and a few various files in seperate directories.  

	If you could help me out I would be very appreciative.


					Thankyou for your assistance,

					
					Kevin Jay Marshall.