[R6RS] shift operators

William D Clinger will at ccs.neu.edu
Mon Apr 17 14:31:24 EDT 2006


Kent wrote:
> That's all fine, but my take is a bit different: the fx operators should
> behave like the corresponding arbitrary-precision versions within the
> fixnum range, with full error checking in safe mode and (possibly) native
> (near single-instruction) efficiency in unsafe mode.

We are in agreement, but I wasn't sure the editors fully
understood the implications; in particular, I didn't.
The "behave like the corresponding arbitrary-precision
versions" means the fx operators *must* signal an error
rather than return some result that depends on the precision
of fixnums.  That implies a potential performance penalty,
even for the shift operations, which must signal an error
(in safe mode) rather than drop bits that are shifted out
of the fixnum range.

> Diverging from SRFI 60 doesn't seem like a big deal...

In that case, I will revise the SRFI's specification for
the shift operations and for all of the operations that I
questioned in the issues list.

> Ah, I see.  I agree with you that fx+ (and others as appropriate)
> should be restricted to two arguments.

Good.

I won't get around to making these changes until Wednesday.

Will



More information about the R6RS mailing list