eq? is a predicate for eof
original commit: f73d63e1afdca9f509ff0a143ae2348875766ce2
This commit is contained in:
parent
8ddbeba6e3
commit
36d46fac77
|
@ -811,7 +811,14 @@
|
|||
[tc-err (do: : Void
|
||||
([j : Natural (+ i 'a) (+ j i)])
|
||||
((>= 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
|
||||
"check-type tests"
|
||||
(test-exn "Fails correctly" exn:fail:syntax? (lambda () (parameterize ([orig-module-stx #'here])
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
;; typecheck eq? applications
|
||||
;; identifier expr expr -> tc-results
|
||||
(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 (equal?-able e) #t)
|
||||
(define (ok? val)
|
||||
|
|
Loading…
Reference in New Issue
Block a user