Whoops! You're right, of course. Sorry for the confusion.

(I'd never read the errata - lots of neat stuff in there.)


On Sep 18, 2017 2:30 AM, "Mark H Weaver" <m...@netris.org> wrote:

> Mark H Weaver <m...@netris.org> writes:
>
> > Julian Graham <jool...@gmail.com> 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 [0] 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-if mask
>                 (bitwise-arithmetic-shift-left ei3 ei2)
>                 ei1))
>
> and this unambiguously required that the 0th bit of 'ei3' is the bit
> that is copied.
>
>       Mark
>

Reply via email to