The specification for bitwise-rotate-bit-field says:
Ei2, ei3, ei4 must be non-negative, ei2 must be less than or equal to 
ei3, and ei4 must be non-negative.

First, the requirement that ei4 (count) be non-negative is repeated.

Second, why must ei4 be non-negative?  Just like
bitwise-arithmatic-shift shifts left or right depending on the sign
of the shift amount, it seems reasonable to allow negative shifts
on a rotate.  That doesn't allow any extra functionality,
but it seems a useful convenience.  Especially since the
"reference implementation" handles negative shifts automatically,
thanks to the use the the mod operator:

(let* ((count (mod count width))

I.e. shift by (- count) bits is the same as a shift by
(- width count) bits.
-- 
        --Per Bothner
[EMAIL PROTECTED]   http://per.bothner.com/

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to