corret c98b0e6 so that empty? is not provided by racket/base

also do the same treatment with cons? as with empty?
This commit is contained in:
Robby Findler 2018-01-28 14:45:35 -06:00
parent 32e12fded4
commit 551db6c1ef
4 changed files with 15 additions and 12 deletions

View File

@ -13,9 +13,10 @@
(require setup/main-collects (require setup/main-collects
racket/struct-info racket/struct-info
(only-in racket/private/list empty?) (only-in racket/private/list-predicates empty? cons?)
(for-template racket/base (for-template racket/base
(only-in racket/private/list empty?))) (only-in racket/private/list-predicates
empty? cons?)))
(define (update-loc stx loc) (define (update-loc stx loc)
(datum->syntax stx (syntax-e stx) loc)) (datum->syntax stx (syntax-e stx) loc))
@ -191,7 +192,7 @@
string<=? string<=?
#:key symbol->string))) #:key symbol->string)))
-- also add empty? to the above -- also add empty? and cons? to the above
|# |#
@ -370,8 +371,9 @@
(weak-box? . #t) (weak-box? . #t)
(will-executor? . #t) (will-executor? . #t)
(zero? . #t) (zero? . #t)
;; from racket/private/list ;; from racket/private/list-predicates
(empty? . #t))) (empty? . #t)
(cons? . #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

@ -62,7 +62,7 @@
remf*) remf*)
(require (for-syntax racket/base) (require (for-syntax racket/base)
(only-in racket/private/list empty?)) "private/list-predicates.rkt")
(define (first x) (define (first x)
(if (and (pair? x) (list? x)) (if (and (pair? x) (list? x))
@ -112,7 +112,6 @@
(cdr l) (cdr l)
(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 empty '()) (define empty '())
(define (make-list n x) (define (make-list n x)

View File

@ -0,0 +1,6 @@
#lang racket/base
(provide empty? cons?)
(define (empty? l) (null? l))
(define (cons? l) (pair? l))

View File

@ -30,11 +30,7 @@
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")