fix use of `eqv?` with `+inf.0`

The current Racket implementation preserves the `eq?`ness of `+inf.0`
enough to mostly hide this problem.
v6.12
Matthew Flatt 7 years ago
parent 80ea2be9e9
commit f3e1f09693

@ -172,7 +172,7 @@
((and (= 0 low) (or (= 0 high) (eq? z r))) e) ((and (= 0 low) (or (= 0 high) (eq? z r))) e)
((and (= 1 low) (= 1 high)) r) ((and (= 1 low) (= 1 high)) r)
((and (repeatR? r) ((and (repeatR? r)
(eq? (repeatR-high r) +inf.0) (eqv? (repeatR-high r) +inf.0)
(or (= 0 (repeatR-low r)) (or (= 0 (repeatR-low r))
(= 1 (repeatR-low r)))) (= 1 (repeatR-low r))))
(build-repeat (* low (repeatR-low r)) (build-repeat (* low (repeatR-low r))

@ -84,7 +84,7 @@
stx stx
(car arg-list))) (car arg-list)))
(unless (or (and (number? high) (exact? high) (integer? high) (>= high 0)) (unless (or (and (number? high) (exact? high) (integer? high) (>= high 0))
(eq? high +inf.0)) (eqv? high +inf.0))
(raise-syntax-error #f (raise-syntax-error #f
"not a non-negative exact integer or +inf.0" "not a non-negative exact integer or +inf.0"
stx stx

Loading…
Cancel
Save