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:
parent
42f4784735
commit
94dbcb12dc
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
;; NULL
|
;; NULL
|
||||||
|
|
||||||
(define sql-null
|
(define-values (sql-null sql-null?)
|
||||||
(let ()
|
(let ()
|
||||||
(struct sql-null ()
|
(struct sql-null ()
|
||||||
;; must deserialize to singleton, so can't just use serializable-struct
|
;; must deserialize to singleton, so can't just use serializable-struct
|
||||||
|
@ -20,10 +20,7 @@
|
||||||
#f
|
#f
|
||||||
(or (current-load-relative-directory)
|
(or (current-load-relative-directory)
|
||||||
(current-directory))))
|
(current-directory))))
|
||||||
(sql-null)))
|
(values (sql-null) sql-null?)))
|
||||||
|
|
||||||
(define (sql-null? x)
|
|
||||||
(eq? x sql-null))
|
|
||||||
|
|
||||||
(define (sql-null->false x)
|
(define (sql-null->false x)
|
||||||
(if (eq? x sql-null)
|
(if (eq? x sql-null)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user