[racket] begin vs +

From: Keiko Nakata (keiko at kurims.kyoto-u.ac.jp)
Date: Mon Aug 2 09:48:07 EDT 2010

From: Laurent <laurent.orseau at gmail.com>

> Maybe you could use `(let () *body ...*)' instead? It should be closer to
> your intentions.

Can you tweak my 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))

or give me a hint, so that it would undo the assignment?
I mean at the point of let/cc, where I come back with (unbox d), 
(set-box! a 2) is not yet performed. 

Or, call/cc does not capture the state?
(Locations could be outside the prompt.)

Or, most likely, I am still confusing?

Keiko


Posted on the users mailing list.