Make sql-null? a struct predicate. (#1450)

This allows Typed Racket to know that it's pure and safe to use
as an opaque value.
This commit is contained in:
Sam Tobin-Hochstadt 2016-09-07 10:57:10 -04:00 committed by Ryan Culpepper
parent 42f4784735
commit 94dbcb12dc

View File

@ -10,7 +10,7 @@
;; NULL
(define sql-null
(define-values (sql-null sql-null?)
(let ()
(struct sql-null ()
;; must deserialize to singleton, so can't just use serializable-struct
@ -20,10 +20,7 @@
#f
(or (current-load-relative-directory)
(current-directory))))
(sql-null)))
(define (sql-null? x)
(eq? x sql-null))
(values (sql-null) sql-null?)))
(define (sql-null->false x)
(if (eq? x sql-null)