[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fix:lsh signedness

From: Taylor R Campbell
Subject: Re: fix:lsh signedness
Date: Sat, 31 Oct 2020 01:11:56 +0000

> Date: Fri, 30 Oct 2020 17:48:49 -0700
> From: "Arthur A. Gleckler" <>
> On Fri, Oct 30, 2020 at 4:59 PM Taylor R Campbell 
> <> wrote:
> > - When Arthur originally documented the fix:lsh procedure in 1991
> >   (bbc428a9), he documented arithmetic right shift semantics.
> I'm pretty sure I don't deserve credit for that.  If you look at the rest
> of that commit, you can see that I checked in the entire reference manual
> and user manual.  I did contribute a bunch of documentation, including much
> of the original debugging documentation, but I definitely didn't write both
> of those manuals.  In fact, you can see "@author by Chris Hanson" in both
> of them.

Oops -- I was just going by the commit logs.  So I guess Chris
originally documented fix:lsh with arithmetic right shifts, then
documented it with logical right shifts -- and then (decades) later
implemented the R7RSish fxarithmetic-shift via the fixnum-lsh

> > What to do?
> Considering how frequently people have come to different interpretations of
> the abbreviation lsh, perhaps it should be renamed to logical-shift or
> something else unambiguous.

Introducing a new name for a useful operation is fine by me (if it is
demonstrated to be useful -- you can always get a logical right shift
by AND'ing an arithmetic right shift with an appropriate mask).

But the question is what to do with the existing name, which on i386
and amd64 has been arithmetic for a decade but has vestiges of being
logical in other places (a rather illogical state of affairs!).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]