eq? is a predicate for eof
This commit is contained in:
parent
05877f4537
commit
f73d63e1af
|
@ -811,7 +811,14 @@
|
||||||
[tc-err (do: : Void
|
[tc-err (do: : Void
|
||||||
([j : Natural (+ i 'a) (+ j i)])
|
([j : Natural (+ i 'a) (+ j i)])
|
||||||
((>= j 10))
|
((>= j 10))
|
||||||
#f)])
|
#f)]
|
||||||
|
[tc-e/t
|
||||||
|
(let ([x eof])
|
||||||
|
(if (procedure? x)
|
||||||
|
x
|
||||||
|
(lambda (z) (eq? x z))))
|
||||||
|
(make-pred-ty (-val eof))]
|
||||||
|
)
|
||||||
(test-suite
|
(test-suite
|
||||||
"check-type tests"
|
"check-type tests"
|
||||||
(test-exn "Fails correctly" exn:fail:syntax? (lambda () (parameterize ([orig-module-stx #'here])
|
(test-exn "Fails correctly" exn:fail:syntax? (lambda () (parameterize ([orig-module-stx #'here])
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
;; typecheck eq? applications
|
;; typecheck eq? applications
|
||||||
;; identifier expr expr -> tc-results
|
;; identifier expr expr -> tc-results
|
||||||
(define (tc/eq comparator v1 v2)
|
(define (tc/eq comparator v1 v2)
|
||||||
(define (eq?-able e) (or (boolean? e) (keyword? e) (symbol? e)))
|
(define (eq?-able e) (or (boolean? e) (keyword? e) (symbol? e) (eof-object? e)))
|
||||||
(define (eqv?-able e) (or (eq?-able e) (number? e)))
|
(define (eqv?-able e) (or (eq?-able e) (number? e)))
|
||||||
(define (equal?-able e) #t)
|
(define (equal?-able e) #t)
|
||||||
(define (ok? val)
|
(define (ok? val)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user