<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>#|QUESTION/REMARK<BR>Consider: a fluid-let form in
DrScheme, version 103p1<BR>-that dynamically assigns a value "original" to a
variable<BR>-whose body assigns a new value "new" to this variable<BR>-then
exits the dynamic extent of the fluid-let form by means<BR> of a
continuation<BR>-then regains control because a continuation is called that
is<BR> located in the dynamic extent of the fluid-let form<BR>It appears
that fluid-let restores the "original" value,<BR>not the "new" value. See
example 1. For me it seems more logical<BR>fluid-let to behave like example 2.
|#</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>;Welcome to DrScheme, version 103p1.<BR>;Language:
Graphical Full Scheme (MrEd).<BR>;Example 1</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>(define a 10)<BR>(define b 20)<BR>(define (printer)
(write (list a b)) (newline))<BR>(define done?
#f)<BR>(let<BR> ((return<BR> (let/cc call<BR>
(fluid-let ((a 100) (b 200))<BR>
(printer)<BR> (set! a 1000) (set! b
2000)<BR> (let/cc return (call
return))<BR> (printer)))))<BR> (if (not
done?)<BR> (begin (set! done? #t) (printer)<BR> (set! a 10000)
(set! b 20000) (return
(void))))<BR> (printer)<BR> (void))</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>;written:<BR>;(100 200)<BR>;(10 20)<BR>;(100
200)<BR>;(10 20)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>;Welcome to DrScheme, version 103p1.<BR>;Language:
Graphical Full Scheme (MrEd).<BR>;Example 2</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>(define a 10)<BR>(define b 20)<BR>(define (printer)
(write (list a b)) (newline))<BR>(define done?
#f)<BR>(let<BR> ((return<BR> (let/cc call<BR>
(let ((values '(100 200)))<BR>
(let<BR>
((switch-values<BR> (lambda
()<BR> (define temp (list a
b))<BR> (set! a (car
values))<BR> (set! b (cadr
values))<BR> (set! values
temp))))<BR>
(dynamic-wind<BR> switch-values
<BR> (lambda
()<BR>
(printer)<BR> (set! a 1000) (set! b
2000)<BR> (let/cc return (call
return))<BR>
(printer))<BR>
switch-values))))))<BR> (if (not done?)<BR> (begin (set! done? #t)
(printer)<BR> (set! a 10000) (set! b 20000) (return
(void))))<BR> (printer)<BR> (void))</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>;written:<BR>;(100 200)<BR>;(10 20)<BR>;(1000
2000)<BR>;(10000 20000)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><BR></FONT> </DIV></BODY></HTML>