Added a single argument (fx- n) case that was missing.

This commit is contained in:
Abdulaziz Ghuloum 2008-02-12 16:43:15 -05:00
parent bde9000c06
commit 08fda34ebe
3 changed files with 21 additions and 14 deletions

View File

@ -77,29 +77,35 @@
($fxlognot x)))
(define (make-fx-error who msg)
(lambda (x y)
(if (fixnum? x)
(if (fixnum? y)
(die who msg x y)
(die who "not a fixnum" y))
(die who "not a fixnum" x))))
(case-lambda
[(x y)
(if (fixnum? x)
(if (fixnum? y)
(die who msg x y)
(die who "not a fixnum" y))
(die who "not a fixnum" x))]
[(x)
(if (fixnum? x)
(die who msg x)
(die who "not a fixnum" x))]))
(define error@fx+
(make-fx-error 'fx+ "overflow when adding numbers"))
(make-fx-error 'fx+ "overflow during addition"))
(define error@fx-
(make-fx-error 'fx- "overflow when subtracting numbers"))
(make-fx-error 'fx- "overflow during subtraction"))
(define error@fx*
(make-fx-error 'fx* "overflow when multiplying numbers"))
(make-fx-error 'fx* "overflow during multiplication"))
(define (fx+ x y) (sys:fx+ x y))
(define (fx* x y) (sys:fx* x y))
(define (fx- x y) (sys:fx- x y))
(define fx-
(case-lambda
[(x y) (sys:fx- x y)]
[(x) (sys:fx- x)]))
(define false-loop
(lambda (who ls)

View File

@ -1 +1 @@
1380
1381

View File

@ -1244,10 +1244,11 @@
[(E) (nop)]
[(E a . a*) (assert-fixnums a a*)])
(define-primop fx+ safe
[(V x y) (cogen-value-+ x y)])
(define-primop fx- safe
[(V x) (cogen-value-- (K 0) x)]
[(V x y) (cogen-value-- x y)])
(define-primop fx* safe