[plt-scheme] semantics of letrec in Lazy Scheme

From: Keiko Nakata (keiko at kurims.kyoto-u.ac.jp)
Date: Tue Jun 2 07:39:32 EDT 2009


In the following Lazy Scheme code, u is bound to #<undefiend>, 
whereas u1 and u2 are to promises producing 5. 
Why is u exceptional? 

#lang lazy

(define u (letrec ([x y] [y 5]) x))
(define u1 (letrec ([x (print y)] [y 5]) x))
(define u2 (letrec ([x (begin (print y) y)] [y 5]) x))


Posted on the users mailing list.