On Mon, Aug 2, 2010 at 15:23, Keiko Nakata <ke...@kurims.kyoto-u.ac.jp>wrote:
> Hi, > > From: Matthew Flatt <mfl...@cs.utah.edu> > > > At Mon, 02 Aug 2010 21:54:54 +0900 (JST), Keiko Nakata wrote: > > > Why this code > > > > > > (let ([d (box #f)] [a (box 0)]) > > > (print (+ (begin (let/cc k (begin (set-box! d k) (set-box! a 2) 3))) > (unbox > > > a))) > > > ((unbox d) 9)) > > > > > > prints 511111111, rather than 59999999? > > > > I'm not sure I'm following. Can you say more about why you expect > > infinite "9"s instead of infinite "11"s? > > I wanted to undo the assignment (set-box! d k), but I think I am confusing. > I'm a novice to continuations... > > I used begin to enforce sequentiality, but seemed to be trapped by it. > Maybe you could use `(let () *body ...*)' instead? It should be closer to your intentions.
_________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users