More fixnum improvements.
original commit: 3251712ef79832415b371a7ff2c6593da0372411
This commit is contained in:
parent
a7b787db6c
commit
680e7fee29
|
@ -53,7 +53,7 @@
|
|||
[rational? (make-pred-ty -Real)]
|
||||
[exact? (asym-pred N B (-FS -top (-not-filter -ExactRational 0)))]
|
||||
[inexact? (asym-pred N B (-FS -top (-not-filter -Flonum 0)))]
|
||||
[fixnum? (asym-pred Univ B (-FS (-filter -Integer 0) -top))]
|
||||
[fixnum? (make-pred-ty -Fixnum)]
|
||||
[positive? (-> -Real B)]
|
||||
[negative? (-> -Real B)]
|
||||
[exact-positive-integer? (make-pred-ty -Pos)]
|
||||
|
|
|
@ -599,11 +599,12 @@
|
|||
[_ (int-err "bad expected: ~a" expected)])]
|
||||
;; special case for `-' used like `sub1'
|
||||
[(#%plain-app (~and op (~literal -)) v (~and arg2 ((~literal quote) 1)))
|
||||
(add-typeof-expr #'arg2 (ret -Nat))
|
||||
(add-typeof-expr #'arg2 (ret -PositiveFixnum))
|
||||
(match-let ([(tc-result1: t) (single-value #'v)])
|
||||
(if (subtype t -ExactPositiveInteger)
|
||||
(ret -Nat)
|
||||
(tc/funapp #'op #'(v arg2) (single-value #'op) (list (ret t) (single-value #'arg2)) expected)))]
|
||||
(cond
|
||||
[(subtype t (Un -Zero -PositiveFixnum)) (ret -Fixnum)]
|
||||
[(subtype t -ExactPositiveInteger) (ret -Nat)]
|
||||
[else (tc/funapp #'op #'(v arg2) (single-value #'op) (list (ret t) (single-value #'arg2)) expected)]))]
|
||||
;; call-with-values
|
||||
[(#%plain-app call-with-values prod con)
|
||||
(match (tc/funapp #'prod #'() (single-value #'prod) null #f)
|
||||
|
|
Loading…
Reference in New Issue
Block a user