cs: use black hole for unsafe-undefined representation

This commit is contained in:
Matthew Flatt 2020-01-30 20:18:12 -07:00
parent ad9dc342f8
commit 8da6e9bd6b

View File

@ -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)