Subject: bug#56641: Deprecate `lsh`

From: Mattias Engdegård <[email-masked]>
Date: Thu, 21 Jul 2022 09:47:52 +0200

21 juli 2022 kl. 03.43 skrev Po Lu <[email-masked]>:

> 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.