whalesong icon indicating copy to clipboard operation
whalesong copied to clipboard

Behaviour of (letrec ([x x]) x) changed in Racket

Open soegaard opened this issue 10 years ago • 2 comments

The latest Racket has changed the behaviour of (letrec ([x x]) x). Currently any program beginning with #lang whalesong fails due to an "x undefined" error. The undefined value is now exported from racket/undefined.

soegaard avatar Jun 29 '14 22:06 soegaard

Note that (letrec ([x x]) x) is used in other files too:

grep -r undefined * | grep letrec whalesong/cs019/private/sigs-patched.rkt:(define the-undefined-value (letrec ([x x]) x)) whalesong/cs019/teach-runtime.rkt:(define undefined (letrec ([x x]) x)) whalesong/tests/older-tests/moby-programs/misc.rkt:(check-expect (undefined? (letrec ([x x]) x)) true)

soegaard avatar Jun 29 '14 22:06 soegaard

Also in kernel.rkt the function -undefined? could be replaced with: (require racket/undefined) (define (-undefined? x) (eq? x undefined))

soegaard avatar Jun 29 '14 23:06 soegaard