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:
parent
32e12fded4
commit
551db6c1ef
|
@ -13,9 +13,10 @@
|
|||
|
||||
(require setup/main-collects
|
||||
racket/struct-info
|
||||
(only-in racket/private/list empty?)
|
||||
(only-in racket/private/list-predicates empty? cons?)
|
||||
(for-template racket/base
|
||||
(only-in racket/private/list empty?)))
|
||||
(only-in racket/private/list-predicates
|
||||
empty? cons?)))
|
||||
|
||||
(define (update-loc stx loc)
|
||||
(datum->syntax stx (syntax-e stx) loc))
|
||||
|
@ -191,7 +192,7 @@
|
|||
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)
|
||||
(will-executor? . #t)
|
||||
(zero? . #t)
|
||||
;; from racket/private/list
|
||||
(empty? . #t)))
|
||||
;; from racket/private/list-predicates
|
||||
(empty? . #t)
|
||||
(cons? . #t)))
|
||||
|
||||
(define (known-good-contract? id)
|
||||
(define r-id (syntax-e id))
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
remf*)
|
||||
|
||||
(require (for-syntax racket/base)
|
||||
(only-in racket/private/list empty?))
|
||||
"private/list-predicates.rkt")
|
||||
|
||||
(define (first x)
|
||||
(if (and (pair? x) (list? x))
|
||||
|
@ -112,7 +112,6 @@
|
|||
(cdr l)
|
||||
(raise-argument-error 'rest "(and/c list? (not/c empty?))" l)))
|
||||
|
||||
(define (cons? l) (pair? l))
|
||||
(define empty '())
|
||||
|
||||
(define (make-list n x)
|
||||
|
|
6
racket/collects/racket/private/list-predicates.rkt
Normal file
6
racket/collects/racket/private/list-predicates.rkt
Normal file
|
@ -0,0 +1,6 @@
|
|||
#lang racket/base
|
||||
|
||||
(provide empty? cons?)
|
||||
|
||||
(define (empty? l) (null? l))
|
||||
(define (cons? l) (pair? l))
|
|
@ -30,11 +30,7 @@
|
|||
reverse
|
||||
|
||||
compose
|
||||
compose1
|
||||
|
||||
empty?)
|
||||
|
||||
(define (empty? l) (null? l))
|
||||
compose1)
|
||||
|
||||
(#%require (rename "sort.rkt" raw-sort sort)
|
||||
(for-syntax "stxcase-scheme.rkt")
|
||||
|
|
Loading…
Reference in New Issue
Block a user