Zap a bunch more `define-contract' forms.
svn: r15971
This commit is contained in:
parent
ed269cc43b
commit
b6ca1e1673
|
@ -151,13 +151,14 @@
|
||||||
#'(at ?param (property ?accessor ?param))))
|
#'(at ?param (property ?accessor ?param))))
|
||||||
(syntax->list #'(our-accessor ...))
|
(syntax->list #'(our-accessor ...))
|
||||||
(syntax->list #'(?param ...)))))
|
(syntax->list #'(?param ...)))))
|
||||||
#'(define-contract ?type-spec
|
#'(define ?type-spec
|
||||||
(combined (at ?type-name (predicate real-predicate))
|
(contract
|
||||||
component-contract ...))))
|
(combined (at ?type-name (predicate real-predicate))
|
||||||
|
component-contract ...)))))
|
||||||
(_
|
(_
|
||||||
;; we use real-predicate to avoid infinite recursion if a contract
|
;; we use real-predicate to avoid infinite recursion if a contract
|
||||||
;; for ?type-name using ?predicate is inadvertently defined
|
;; for ?type-name using ?predicate is inadvertently defined
|
||||||
#'(define-contract ?type-name (predicate real-predicate))))))
|
#'(define ?type-name (contract (predicate real-predicate)))))))
|
||||||
(with-syntax ((defs
|
(with-syntax ((defs
|
||||||
(stepper-syntax-property
|
(stepper-syntax-property
|
||||||
(syntax/loc x defs) 'stepper-skip-completely #t))
|
(syntax/loc x defs) 'stepper-skip-completely #t))
|
||||||
|
|
|
@ -141,10 +141,11 @@ Vertrag.
|
||||||
Aus der Datendefinition entsteht eine Vertragsdefinition folgender Form:
|
Aus der Datendefinition entsteht eine Vertragsdefinition folgender Form:
|
||||||
|
|
||||||
@schemeblock[
|
@schemeblock[
|
||||||
(define-contract ctr
|
(define ctr
|
||||||
(mixed #,(elem (scheme ctr) (subscript "1"))
|
(contract
|
||||||
...
|
(mixed #,(elem (scheme ctr) (subscript "1"))
|
||||||
#,(elem (scheme ctr) (subscript "n"))))
|
...
|
||||||
|
#,(elem (scheme ctr) (subscript "n")))))
|
||||||
]
|
]
|
||||||
|
|
||||||
Wenn die Prädikate für die einzelnen Sorten @elem[(scheme pred?)
|
Wenn die Prädikate für die einzelnen Sorten @elem[(scheme pred?)
|
||||||
|
|
|
@ -191,7 +191,7 @@
|
||||||
|
|
||||||
(test-case
|
(test-case
|
||||||
"predicate"
|
"predicate"
|
||||||
(define-contract integer (predicate integer?))
|
(define integer (predicate integer?))
|
||||||
(check-equal? (say-no (apply-contract integer 5)) 5)
|
(check-equal? (say-no (apply-contract integer 5)) 5)
|
||||||
(check-equal? (say-no (apply-contract integer "foo")) 'no))
|
(check-equal? (say-no (apply-contract integer "foo")) 'no))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user