GNU bug report logs - #56641
Deprecate `lsh`

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattiase <at> acm.org>

Date: Tue, 19 Jul 2022 13:39:01 UTC

Severity: normal

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


Message #53 received at 56641 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, stefankangas <at> gmail.com, 56641 <at> debbugs.gnu.org
Subject: Re: bug#56641: Deprecate `lsh`
Date: Thu, 21 Jul 2022 09:47:52 +0200
21 juli 2022 kl. 03.43 skrev Po Lu <luangruo <at> yahoo.com>:

> Which is the obvious use? For compatibility with programs (not
> necessarily within Emacs) that expect different values based on the
> number of VALBITs in the Emacs machine file?

Honestly I don't know. Even before Emacs 27, `lsh` seems a bit questionable since the width is both platform-dependent and unlike C, say, isn't a particularly useful size. It doesn't correspond to anything in hardware, isn't a power of two or anything like that.

It could be code that expects (lsh x -29) to return the sign bit as 1 or 0, as some kind of 'optimisation', what do I know.

Also see bug#32463 for some discussion about lsh during the transition to bignums. Basically everyone agreed that it's useless but that it probably needs to be kept for compatibility in some way.





This bug report was last modified 2 years and 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.