Skip to content

Commit

Permalink
Make sql-null? a struct predicate. (racket#1450)
Browse files Browse the repository at this point in the history
This allows Typed Racket to know that it's pure and safe to use
as an opaque value.
  • Loading branch information
samth authored and rmculpepper committed Sep 7, 2016
1 parent 42f4784 commit 94dbcb1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions racket/collects/db/private/generic/sql-data.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 94dbcb1

Please sign in to comment.