Subject: Re: call/1cc and call-with-exit-continuation
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 17 May 2001 02:11:09 GMT
Newsgroups: comp.lang.scheme
Message-ID: <9dvbvt$8uo1a$1@fido.engr.sgi.com>
Antti Huima  <huima@localhost.localdomain> wrote:
+---------------
| Another way to reduce the potential overhead of continuations would be
| to capture an `exit continuation'...
| Is there some other name for this construct? Do you know of Scheme
| systems that support it? Has it been found useful?
+---------------

MzScheme provides "escape continuations":

	<URL:http://www.cs.rice.edu/CS/PLT/packages/doc/mzscheme/node86.htm>
	...
	In addition to regular call/cc, MzScheme provides
	call-with-escape-continuation (or call/ec) and let/ec.
	A continuation obtained from call/ec can only be used to
	escape back to the continuation; i.e., an escape continuation
	is only valid when the current continuation is an extension
	of the escape continuation. The application of call/ec's
	argument is not a tail call. 

	Escape continuations are provided for two reasons: 1) they
	are significantly cheaper than full continuations; and
	2) full continuations are not allowed to cross certain
	boundaries (e.g., error handling) that escape continuations
	can safely cross.

"Let/ec" allows a style somewhat like Common Lisp's "catch/throw".


-Rob

-----
Rob Warnock, 31-2-510		rpw3@sgi.com
SGI Network Engineering		<URL:http://reality.sgi.com/rpw3/>
1600 Amphitheatre Pkwy.		Phone: 650-933-1673
Mountain View, CA  94043	PP-ASEL-IA