[racket] Promises and parameters

From: Tony Garnock-Jones (tonyg at ccs.neu.edu)
Date: Thu Oct 30 17:57:31 EDT 2014

Hi all,

Does this seem like the morally-correct thing for promises to do in the
presence of parameters?

-> (define x (make-parameter 3))
-> (define y (parameterize ((x 4)) (delay (list (x)))))
-> (parameterize ((x 5)) (force y))
'(5)

I was expecting '(4), because I felt that delay should be more like let
than lambda, if you see what I mean. That is, I expected that (delay
expr) and (let ((foo expr)) (delay foo)) should be pretty similar except
for exactly when expr gets evaluated.

Tony

Posted on the users mailing list.