* moved fx=, fx<, fx<=, fx>, and fx>= to the fixnums library.
This commit is contained in:
parent
ca660f5e75
commit
ffeff47eb4
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -64,46 +64,7 @@
|
||||||
(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! '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! 'char=?
|
(primitive-set! 'char=?
|
||||||
(let ()
|
(let ()
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
|
|
||||||
(library (ikarus fixnums)
|
(library (ikarus fixnums)
|
||||||
(export fxzero? fxadd1 fxsub1 fxlognot fx+ fx- fx* fxquotient
|
(export fxzero? fxadd1 fxsub1 fxlognot fx+ fx- fx* fxquotient
|
||||||
fxremainder fxmodulo fxlogor fxlogand fxlogxor fxsll fxsra)
|
fxremainder fxmodulo fxlogor fxlogand fxlogxor fxsll fxsra
|
||||||
|
fx= fx< fx<= fx> fx>=)
|
||||||
(import
|
(import
|
||||||
(only (scheme) $fxadd1 $fxsub1 $fxlognot $fxzero? $fxquotient
|
(only (scheme) $fxadd1 $fxsub1 $fxlognot $fxzero? $fxquotient
|
||||||
$fxmodulo $fx+ $fx- $fx* $fxlogor $fxlogand $fxlogxor
|
$fxmodulo $fx+ $fx- $fx* $fxlogor $fxlogand $fxlogxor
|
||||||
$fxsll $fxsra $fx>=)
|
$fxsll $fxsra $fx= $fx< $fx<= $fx> $fx>=)
|
||||||
(except (ikarus) fxzero? fxadd1 fxsub1 fxlognot fx+ fx- fx*
|
(except (ikarus) fxzero? fxadd1 fxsub1 fxlognot fx+ fx- fx*
|
||||||
fxquotient fxremainder fxmodulo fxlogor fxlogand
|
fxquotient fxremainder fxmodulo fxlogor fxlogand
|
||||||
fxlogxor fxsll fxsra))
|
fxlogxor fxsll fxsra fx= fx< fx<= fx> fx>=))
|
||||||
|
|
||||||
(define fxzero?
|
(define fxzero?
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
|
@ -58,7 +59,47 @@
|
||||||
(unless (fixnum? y)
|
(unless (fixnum? y)
|
||||||
(error 'fx* "~s is not a fixnum" y))
|
(error 'fx* "~s is not a fixnum" y))
|
||||||
($fx* x 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)))
|
||||||
|
|
||||||
|
(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)))
|
||||||
|
|
||||||
(define fxquotient
|
(define fxquotient
|
||||||
(lambda (x y)
|
(lambda (x y)
|
||||||
(unless (fixnum? x)
|
(unless (fixnum? x)
|
||||||
|
|
Loading…
Reference in New Issue