From a896cf4abda0d862a837570553342a762a74312c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Axel=20S=C3=B8gaard?= Date: Tue, 12 Aug 2014 19:52:58 +0200 Subject: [PATCH] Make the undefined value unique. --- whalesong/lang/kernel.rkt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/whalesong/lang/kernel.rkt b/whalesong/lang/kernel.rkt index 1195cd2..e66a314 100644 --- a/whalesong/lang/kernel.rkt +++ b/whalesong/lang/kernel.rkt @@ -40,12 +40,13 @@ ;; Custom letrec and letrec-values in order to avoid running ;; into the (in Racket) newly introduced undefined value. -(provide letrec letrec-values) +(provide letrec letrec-values) +(define unique-undefined-value (list ')) (define-syntax (letrec stx) (syntax-case stx () [(_ ([id expr] ...) body ...) (syntax/loc stx - (let ([id '**undefined**] ...) + (let ([id unique-undefined-value] ...) (set! id expr) ... (let () body ...)))])) @@ -53,7 +54,7 @@ (syntax-case stx () [(_ ([(id ...) expr] ...) body ...) (syntax/loc stx - (let ([id '**undefined**] ... ...) + (let ([id unique-undefined-value] ... ...) (set!-values (id ...) expr) ... (let () body ...)))]))