|Subject:||Re: [PATCH] Bring `bitwise-copy-bit' behavior back in line with R6RS.|
|Date:||Mon, 18 Sep 2017 10:18:21 -0400|
Mark H Weaver <address@hidden> writes:
> Julian Graham <address@hidden> writes:
>> It looks like there was a subtle but significant regression introduced
>> to the behavior of `bitwise-copy-bit' in `(rnrs arithmetic bitwise)'
>> back in 93da406f33.
>> R6RS says  that function (with arguments EI1, EI2, EI3) should
>> transfer the EI2th bit from EI3 to EI1, but Guile's implementation was
>> always reading the 0th bit from EI3.
> I was puzzled by this, because the same specification also states that
> "ei3 must be either 0 or 1",
Also note that the same specification also states that the result of
(bitwise-copy-bit ei1 ei2 ei3) is the same as the result of:
(let* ((mask (bitwise-arithmetic-shift-left 1 ei2)))
(bitwise-arithmetic-shift-left ei3 ei2)
and this unambiguously required that the 0th bit of 'ei3' is the bit
that is copied.
|[Prev in Thread]||Current Thread||[Next in Thread]|