diff --git a/src/ikarus.boot b/src/ikarus.boot index 094a786..fcd3700 100644 Binary files a/src/ikarus.boot and b/src/ikarus.boot differ diff --git a/src/ikarus.fixnums.ss b/src/ikarus.fixnums.ss index 3627dbe..7d76d33 100644 --- a/src/ikarus.fixnums.ss +++ b/src/ikarus.fixnums.ss @@ -5,7 +5,7 @@ fxremainder fxmodulo fxlogor fxlogand fxlogxor fxsll fxsra fx= fx< fx<= fx> fx>= fx=? fx? fx>=? - fxior fxand fxxor fxnot + fxior fxand fxxor fxnot fxif fxpositive? fxnegative? fxeven? fxodd? fixnum->string @@ -22,7 +22,7 @@ fxquotient fxremainder fxmodulo fxlogor fxlogand fxlogxor fxsll fxsra fx= fx< fx<= fx> fx>= fx=? fx? fx>=? - fxior fxand fxxor fxnot + fxior fxand fxxor fxnot fxif fxpositive? fxnegative? fxeven? fxodd? fxarithmetic-shift-left fxarithmetic-shift-right fxarithmetic-shift @@ -89,6 +89,7 @@ (error 'fx* "~s is not a fixnum" y)) ($fx* x y))) + (define false-loop (lambda (who ls) (if (pair? ls) @@ -202,6 +203,17 @@ (define fxand (fxbitop fxand $fxlogand -1)) (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 (lambda (x y) (unless (fixnum? x) diff --git a/src/makefile.ss b/src/makefile.ss index f48af9b..6e46d96 100755 --- a/src/makefile.ss +++ b/src/makefile.ss @@ -450,6 +450,7 @@ [fxand i] [fxxor i] [fxnot i] + [fxif i] [fxeven? i] [fxodd? i] [fxpositive? i] diff --git a/src/todo-r6rs.ss b/src/todo-r6rs.ss index 11ec4d8..9603de0 100755 --- a/src/todo-r6rs.ss +++ b/src/todo-r6rs.ss @@ -286,7 +286,7 @@ [fxdiv0-and-mod0 D fx] [fxeven? C fx] [fxfirst-bit-set D fx] - [fxif D fx] + [fxif C fx] [fxior C fx] [fxlength D fx] [fxmax C fx]