[R6RS] shift operators

William D Clinger will at ccs.neu.edu
Sat Apr 15 21:16:19 EDT 2006


Concerning the shift operations, Kent wrote:
> Furthermore, handling negative arguments will require an extra test
> and branch on most machines, and for the fixnum operators, handling
> count arguments greater than the number of bits in a fixnum will
> require an additional test and branch.

Treating a negative argument as a shift in the opposite
direction doesn't require more tests than raising an
exception when the argument is negative, which is what
Kent wants.  Similarly for dealing with count arguments
that are greater than the number of bits in a fixnum.

That leaves me without a rationale for Kent's proposal,
so I'm just going to leave things as are for the moment.

It turns out that some of the fx operations cannot be
implemented using fixed precision arithmetic.  If this
is inconsistent with the editors' intentions, then we
should take another look at the revised spec for the fixnum
operations anyway, and we can discuss the shift operations
along with the fx operations.

Will




More information about the R6RS mailing list