* Added fxif
This commit is contained in:
parent
4b0a0411c0
commit
79916549cd
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -5,7 +5,7 @@
|
||||||
fxremainder fxmodulo fxlogor fxlogand fxlogxor fxsll fxsra
|
fxremainder fxmodulo fxlogor fxlogand fxlogxor fxsll fxsra
|
||||||
fx= fx< fx<= fx> fx>=
|
fx= fx< fx<= fx> fx>=
|
||||||
fx=? fx<? fx<=? fx>? fx>=?
|
fx=? fx<? fx<=? fx>? fx>=?
|
||||||
fxior fxand fxxor fxnot
|
fxior fxand fxxor fxnot fxif
|
||||||
fxpositive? fxnegative?
|
fxpositive? fxnegative?
|
||||||
fxeven? fxodd?
|
fxeven? fxodd?
|
||||||
fixnum->string
|
fixnum->string
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
fxquotient fxremainder fxmodulo fxlogor fxlogand
|
fxquotient fxremainder fxmodulo fxlogor fxlogand
|
||||||
fxlogxor fxsll fxsra fx= fx< fx<= fx> fx>=
|
fxlogxor fxsll fxsra fx= fx< fx<= fx> fx>=
|
||||||
fx=? fx<? fx<=? fx>? fx>=?
|
fx=? fx<? fx<=? fx>? fx>=?
|
||||||
fxior fxand fxxor fxnot
|
fxior fxand fxxor fxnot fxif
|
||||||
fxpositive? fxnegative?
|
fxpositive? fxnegative?
|
||||||
fxeven? fxodd?
|
fxeven? fxodd?
|
||||||
fxarithmetic-shift-left fxarithmetic-shift-right fxarithmetic-shift
|
fxarithmetic-shift-left fxarithmetic-shift-right fxarithmetic-shift
|
||||||
|
@ -89,6 +89,7 @@
|
||||||
(error 'fx* "~s is not a fixnum" y))
|
(error 'fx* "~s is not a fixnum" y))
|
||||||
($fx* x y)))
|
($fx* x y)))
|
||||||
|
|
||||||
|
|
||||||
(define false-loop
|
(define false-loop
|
||||||
(lambda (who ls)
|
(lambda (who ls)
|
||||||
(if (pair? ls)
|
(if (pair? ls)
|
||||||
|
@ -202,6 +203,17 @@
|
||||||
(define fxand (fxbitop fxand $fxlogand -1))
|
(define fxand (fxbitop fxand $fxlogand -1))
|
||||||
(define fxxor (fxbitop fxxor $fxlogxor 0))
|
(define fxxor (fxbitop fxxor $fxlogxor 0))
|
||||||
|
|
||||||
|
(define (fxif x y z)
|
||||||
|
(if (fixnum? x)
|
||||||
|
(if (fixnum? y)
|
||||||
|
(if (fixnum? z)
|
||||||
|
($fxlogor
|
||||||
|
($fxlogand x y)
|
||||||
|
($fxlogand ($fxlognot x) z))
|
||||||
|
(error 'fxif "~s is not a fixnum" z))
|
||||||
|
(error 'fxif "~s is not a fixnum" y))
|
||||||
|
(error 'fxif "~s is not a fixnum" x)))
|
||||||
|
|
||||||
(define fxsra
|
(define fxsra
|
||||||
(lambda (x y)
|
(lambda (x y)
|
||||||
(unless (fixnum? x)
|
(unless (fixnum? x)
|
||||||
|
|
|
@ -450,6 +450,7 @@
|
||||||
[fxand i]
|
[fxand i]
|
||||||
[fxxor i]
|
[fxxor i]
|
||||||
[fxnot i]
|
[fxnot i]
|
||||||
|
[fxif i]
|
||||||
[fxeven? i]
|
[fxeven? i]
|
||||||
[fxodd? i]
|
[fxodd? i]
|
||||||
[fxpositive? i]
|
[fxpositive? i]
|
||||||
|
|
|
@ -286,7 +286,7 @@
|
||||||
[fxdiv0-and-mod0 D fx]
|
[fxdiv0-and-mod0 D fx]
|
||||||
[fxeven? C fx]
|
[fxeven? C fx]
|
||||||
[fxfirst-bit-set D fx]
|
[fxfirst-bit-set D fx]
|
||||||
[fxif D fx]
|
[fxif C fx]
|
||||||
[fxior C fx]
|
[fxior C fx]
|
||||||
[fxlength D fx]
|
[fxlength D fx]
|
||||||
[fxmax C fx]
|
[fxmax C fx]
|
||||||
|
|
Loading…
Reference in New Issue