From 0cb8f0f591d52e5bc6f88598d38a380144cc920b Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 8 Aug 2017 13:51:16 +0000 Subject: [PATCH] Added fxif --- srfi/143.sld | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/srfi/143.sld b/srfi/143.sld index 097d54ea..d8d6793a 100644 --- a/srfi/143.sld +++ b/srfi/143.sld @@ -27,7 +27,8 @@ fxnot fxand fxior fxxor fxarithmetic-shift fxarithmetic-shift-left fxarithmetic-shift-right -; fxbit-count fxlength fxif fxbit-set? fxcopy-bit +; fxbit-count fxlength + fxif ;fxbit-set? fxcopy-bit ; fxfirst-set-bit fxbit-field ; fxbit-field-rotate fxbit-field-reverse ) @@ -45,6 +46,7 @@ fxnot fxand fxior fxxor fxarithmetic-shift fxarithmetic-shift-left fxarithmetic-shift-right + fxif ) (begin (define (fx-width) 31) @@ -127,5 +129,7 @@ (fxarithmetic-shift-right i (fxneg count)))) (bin-num-op fxarithmetic-shift-left "<<") (bin-num-op fxarithmetic-shift-right ">>") + (define (fxif mask i j) + (fxior (fxand (fxnot mask) i) (fxand mask j))) ))