[r6rs-discuss] thinko in spec of fxcopy-bit-field

Abdulaziz Ghuloum aghuloum at cs.indiana.edu
Thu Sep 27 19:31:25 EDT 2007


On Sep 27, 2007, at 5:06 PM, William D Clinger wrote:

> Why, pray tell, must the third argument to fxcopy-bit-field
> be less than (fixnum-width)?

So that your code would still work when you do
(declare unsafe non-r6rs full-speed-forward)
and without the compiler coercing the value of
the shift to some small value.  This also forces
implementors to implement these operations in a
portable, predictable, reliable, and safe manner.


> I understand that the implementation in the 5.97 draft would
> raise an exception without that restriction, but all that
> proves is that the weaknesses and restrictions of the 5.97
> draft make it unnecessarily difficult to program in this
> new language we call Scheme.

I personally prefer the "weakness" over the behavior
found in other languages, such as the following text:

===== C99 on bitwise shift operators
If the value of the right operand is negative or is
greater than or equal to the width of the promoted
left operand, the behavior is undefined.

===== Larceny on fxlsh
If the shift count exceeds the number of bits in the
machine's word size, then the results are machine-
dependent.


Aziz,,,




More information about the r6rs-discuss mailing list