* moved fx+, fx-, and fx* to ikarus.fixnums

This commit is contained in:
Abdulaziz Ghuloum 2007-05-05 04:31:53 -04:00
parent 4ada254c44
commit bdd87d66b5
3 changed files with 30 additions and 34 deletions

Binary file not shown.

View File

@ -25,10 +25,6 @@
(unless (char? x)
(error 'char->integer "~s is not a character" x))
($char->fixnum x)))
(primitive-set! 'gensym?
(lambda (x)
@ -67,32 +63,7 @@
(primitive-set! x v)
(set-top-level-value! x v)))
(primitive-set! 'fx+
(lambda (x y)
(unless (fixnum? x)
(error 'fx+ "~s is not a fixnum" x))
(unless (fixnum? y)
(error 'fx+ "~s is not a fixnum" y))
($fx+ x y)))
(primitive-set! 'fx-
(lambda (x y)
(unless (fixnum? x)
(error 'fx- "~s is not a fixnum" x))
(unless (fixnum? y)
(error 'fx- "~s is not a fixnum" y))
($fx- x y)))
(primitive-set! 'fx*
(lambda (x y)
(unless (fixnum? x)
(error 'fx* "~s is not a fixnum" x))
(unless (fixnum? y)
(error 'fx* "~s is not a fixnum" y))
($fx* x y)))
(primitive-set! 'fxquotient
(lambda (x y)
(unless (fixnum? x)

View File

@ -1,9 +1,9 @@
(library (ikarus fixnums)
(export fxzero? fxadd1 fxsub1 fxlognot)
(export fxzero? fxadd1 fxsub1 fxlognot fx+ fx- fx*)
(import
(only (scheme) $fxadd1 $fxsub1 $fxlognot)
(except (ikarus) fxzero? fxadd1 fxsub1 fxlognot))
(only (scheme) $fxadd1 $fxsub1 $fxlognot $fx+ $fx- $fx*)
(except (ikarus) fxzero? fxadd1 fxsub1 fxlognot fx+ fx- fx*))
(define fxzero?
(lambda (x)
@ -24,10 +24,35 @@
($fxsub1 n)
(error 'fxsub1 "~s is not a fixnum" n))))
(define fxlognot
(lambda (x)
(unless (fixnum? x)
(error 'fxlognot "~s is not a fixnum" x))
($fxlognot x)))
(define fx+
(lambda (x y)
(unless (fixnum? x)
(error 'fx+ "~s is not a fixnum" x))
(unless (fixnum? y)
(error 'fx+ "~s is not a fixnum" y))
($fx+ x y)))
(define fx-
(lambda (x y)
(unless (fixnum? x)
(error 'fx- "~s is not a fixnum" x))
(unless (fixnum? y)
(error 'fx- "~s is not a fixnum" y))
($fx- x y)))
(define fx*
(lambda (x y)
(unless (fixnum? x)
(error 'fx* "~s is not a fixnum" x))
(unless (fixnum? y)
(error 'fx* "~s is not a fixnum" y))
($fx* x y)))
)