Subject: Re: faking dynamic-wind ?
From: (Rob Warnock)
Date: 17 Dec 2000 10:57:21 GMT
Newsgroups: comp.lang.scheme
Message-ID: <91i66h$c16pt$>
Brian Denheyer  <> wrote:
| Is there a way to "fake" dynamic-wind in a scheme which does not
| support it.  It's not obvious to me that it can be done without
| low-level support of some sort.

The minutes of the legendary "June 1992" meeting at Xerox PARC
<URL:> included a "user-mode" reference implementation
of dynamic-wind, but noted:

	Since dynamic-wind interacts with call-with-current-continuation,
	this implementation must replace the usual definition of the latter.

That is, *all* calls to call/cc must be to the one defined in the
dynamic-wind code (which saves away the original function value and
replaces it with its own, by set!-ing the global variable). This can
only work if no built-in route uses call/cc, and if the dynamic-wind
code appears lexical *before* any code that uses call/cc.

| Of course, if you could do it without low level support, then what's
| the point of it being in R5RS, right ?



Rob Warnock, 31-2-510
Network Engineering
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043