dyoo / whalesong

Whalesong: Racket to JavaScript compiler
http://hashcollision.org/whalesong
250 stars 30 forks source link

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

Open soegaard opened 10 years ago

soegaard commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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