add empty? to the list of known-good-contracts

This commit is contained in:
Robby Findler 2018-01-26 16:51:05 -06:00
parent b8171611aa
commit c98b0e6e1e
3 changed files with 15 additions and 5 deletions

View File

@ -13,7 +13,9 @@
(require setup/main-collects (require setup/main-collects
racket/struct-info racket/struct-info
(for-template racket/base)) (only-in racket/private/list empty?)
(for-template racket/base
(only-in racket/private/list empty?)))
(define (update-loc stx loc) (define (update-loc stx loc)
(datum->syntax stx (syntax-e stx) loc)) (datum->syntax stx (syntax-e stx) loc))
@ -189,6 +191,8 @@
string<=? string<=?
#:key symbol->string))) #:key symbol->string)))
-- also add empty? to the above
|# |#
(define known-good-syms-ht (define known-good-syms-ht
@ -365,7 +369,9 @@
(void? . #t) (void? . #t)
(weak-box? . #t) (weak-box? . #t)
(will-executor? . #t) (will-executor? . #t)
(zero? . #t))) (zero? . #t)
;; from racket/private/list
(empty? . #t)))
(define (known-good-contract? id) (define (known-good-contract? id)
(define r-id (syntax-e id)) (define r-id (syntax-e id))

View File

@ -61,7 +61,8 @@
remf remf
remf*) remf*)
(require (for-syntax racket/base)) (require (for-syntax racket/base)
(only-in racket/private/list empty?))
(define (first x) (define (first x)
(if (and (pair? x) (list? x)) (if (and (pair? x) (list? x))
@ -112,7 +113,6 @@
(raise-argument-error 'rest "(and/c list? (not/c empty?))" l))) (raise-argument-error 'rest "(and/c list? (not/c empty?))" l)))
(define (cons? l) (pair? l)) (define (cons? l) (pair? l))
(define (empty? l) (null? l))
(define empty '()) (define empty '())
(define (make-list n x) (define (make-list n x)

View File

@ -30,7 +30,11 @@
reverse reverse
compose compose
compose1) compose1
empty?)
(define (empty? l) (null? l))
(#%require (rename "sort.rkt" raw-sort sort) (#%require (rename "sort.rkt" raw-sort sort)
(for-syntax "stxcase-scheme.rkt") (for-syntax "stxcase-scheme.rkt")