From 8da6e9bd6bbcebfd617c1e37f766b57696cec0d6 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 30 Jan 2020 20:18:12 -0700 Subject: [PATCH] cs: use black hole for `unsafe-undefined` representation --- racket/src/cs/rumble/unsafe.ss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/racket/src/cs/rumble/unsafe.ss b/racket/src/cs/rumble/unsafe.ss index 7f98dc4010..cfbefbf713 100644 --- a/racket/src/cs/rumble/unsafe.ss +++ b/racket/src/cs/rumble/unsafe.ss @@ -172,8 +172,10 @@ (define (unsafe-flimag-part c) (#3%imag-part c)) -(define unsafe-undefined (let ([p (make-record-type "undefined" '())]) - ((record-constructor p)))) +;; The black hole object is an immediate in Chez Scheme, +;; so a use is compact and the optimize can recognize +;; comparsions to itself: +(define unsafe-undefined '#0=#0#) (define (check-not-unsafe-undefined v sym) (when (eq? v unsafe-undefined)