* moved fx+, fx-, and fx* to ikarus.fixnums
This commit is contained in:
parent
4ada254c44
commit
bdd87d66b5
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -26,10 +26,6 @@
|
||||||
(error 'char->integer "~s is not a character" x))
|
(error 'char->integer "~s is not a character" x))
|
||||||
($char->fixnum x)))
|
($char->fixnum x)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(primitive-set! 'gensym?
|
(primitive-set! 'gensym?
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(and (symbol? x)
|
(and (symbol? x)
|
||||||
|
@ -67,31 +63,6 @@
|
||||||
(primitive-set! x v)
|
(primitive-set! x v)
|
||||||
(set-top-level-value! 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
|
(primitive-set! 'fxquotient
|
||||||
(lambda (x y)
|
(lambda (x y)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
(library (ikarus fixnums)
|
(library (ikarus fixnums)
|
||||||
(export fxzero? fxadd1 fxsub1 fxlognot)
|
(export fxzero? fxadd1 fxsub1 fxlognot fx+ fx- fx*)
|
||||||
(import
|
(import
|
||||||
(only (scheme) $fxadd1 $fxsub1 $fxlognot)
|
(only (scheme) $fxadd1 $fxsub1 $fxlognot $fx+ $fx- $fx*)
|
||||||
(except (ikarus) fxzero? fxadd1 fxsub1 fxlognot))
|
(except (ikarus) fxzero? fxadd1 fxsub1 fxlognot fx+ fx- fx*))
|
||||||
|
|
||||||
(define fxzero?
|
(define fxzero?
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
|
@ -24,10 +24,35 @@
|
||||||
($fxsub1 n)
|
($fxsub1 n)
|
||||||
(error 'fxsub1 "~s is not a fixnum" n))))
|
(error 'fxsub1 "~s is not a fixnum" n))))
|
||||||
|
|
||||||
|
|
||||||
(define fxlognot
|
(define fxlognot
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(unless (fixnum? x)
|
(unless (fixnum? x)
|
||||||
(error 'fxlognot "~s is not a fixnum" x))
|
(error 'fxlognot "~s is not a fixnum" x))
|
||||||
($fxlognot 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)))
|
||||||
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue