get rid of now-osolete opt/c code
This commit is contained in:
parent
b47c1857b5
commit
a0cee1ba99
|
@ -7,18 +7,6 @@
|
||||||
(require (for-syntax racket/base
|
(require (for-syntax racket/base
|
||||||
"opt-guts.rkt"))
|
"opt-guts.rkt"))
|
||||||
|
|
||||||
;;
|
|
||||||
;; built-in predicate opters
|
|
||||||
;;
|
|
||||||
(define/opter (null? opt/i opt/info stx) (opt/pred opt/info #'null?))
|
|
||||||
(define/opter (boolean? opt/i opt/info stx) (opt/pred opt/info #'boolean?))
|
|
||||||
(define/opter (string? opt/i opt/info stx) (opt/pred opt/info #'string?))
|
|
||||||
(define/opter (integer? opt/i opt/info stx) (opt/pred opt/info #'integer?))
|
|
||||||
(define/opter (char? opt/i opt/info stx) (opt/pred opt/info #'char?))
|
|
||||||
(define/opter (number? opt/i opt/info stx) (opt/pred opt/info #'number?))
|
|
||||||
(define/opter (pair? opt/i opt/info stx) (opt/pred opt/info #'pair?))
|
|
||||||
(define/opter (not opt/i opt/info stx) (opt/pred opt/info #'not))
|
|
||||||
(define/opter (real? opt/i opt/info stx) (opt/pred opt/info #'real?))
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; any/c
|
;; any/c
|
||||||
|
@ -40,6 +28,7 @@
|
||||||
;; false/c
|
;; false/c
|
||||||
;;
|
;;
|
||||||
(define/opter (false/c opt/i opt/info stx) (opt/pred opt/info #'not #:name '#f))
|
(define/opter (false/c opt/i opt/info stx) (opt/pred opt/info #'not #:name '#f))
|
||||||
|
(define/opter (not opt/i opt/info stx) (opt/pred opt/info #'not))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; flat-contract helper
|
;; flat-contract helper
|
||||||
|
@ -47,12 +36,6 @@
|
||||||
(define-for-syntax (opt/flat-ctc opt/info pred checker)
|
(define-for-syntax (opt/flat-ctc opt/info pred checker)
|
||||||
(syntax-case pred (null? number? integer? boolean? string? pair? not)
|
(syntax-case pred (null? number? integer? boolean? string? pair? not)
|
||||||
;; Better way of doing this?
|
;; Better way of doing this?
|
||||||
[null? (opt/pred opt/info pred)]
|
|
||||||
[number? (opt/pred opt/info pred)]
|
|
||||||
[integer? (opt/pred opt/info pred)]
|
|
||||||
[boolean? (opt/pred opt/info pred)]
|
|
||||||
[string? (opt/pred opt/info pred)]
|
|
||||||
[pair? (opt/pred opt/info pred)]
|
|
||||||
[pred
|
[pred
|
||||||
(let* ((lift-vars (generate-temporaries (syntax (pred error-check))))
|
(let* ((lift-vars (generate-temporaries (syntax (pred error-check))))
|
||||||
(lift-pred (car lift-vars)))
|
(lift-pred (car lift-vars)))
|
||||||
|
@ -83,7 +66,7 @@
|
||||||
#:name #'(object-name lift-pred))))]))
|
#:name #'(object-name lift-pred))))]))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; flat-contract and friends
|
;; flat-contract and flat-named-contract
|
||||||
;;
|
;;
|
||||||
(define/opter (flat-contract opt/i opt/info stx)
|
(define/opter (flat-contract opt/i opt/info stx)
|
||||||
(syntax-case stx (flat-contract)
|
(syntax-case stx (flat-contract)
|
||||||
|
|
|
@ -293,12 +293,6 @@
|
||||||
#'high
|
#'high
|
||||||
'</c)]))
|
'</c)]))
|
||||||
|
|
||||||
;; only used by the opters
|
|
||||||
(define (flat-contract/predicate? pred)
|
|
||||||
(or (flat-contract? pred)
|
|
||||||
(and (procedure? pred)
|
|
||||||
(procedure-arity-includes? pred 1))))
|
|
||||||
|
|
||||||
(define/opter (cons/c opt/i opt/info stx)
|
(define/opter (cons/c opt/i opt/info stx)
|
||||||
(define (opt/cons-ctc hdp tlp)
|
(define (opt/cons-ctc hdp tlp)
|
||||||
(define optres-hd (opt/i opt/info hdp))
|
(define optres-hd (opt/i opt/info hdp))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user