emacs-devel
[Top][All Lists]
Advanced

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

Re: Lisp reader syntax and bootstrap


From: Paul Eggert
Subject: Re: Lisp reader syntax and bootstrap
Date: Thu, 13 Jul 2023 15:07:43 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 2023-07-12 21:27, Po Lu wrote:
Lisp programmers should simply avoid using NaN and Inf

Support for NaN and Inf is ubiquitous nowadays, and it should be OK to write Emacs Lisp programs that use NaN and Inf, especially since Emacs itself uses them in its own Lisp files.

As I actually made money back in the 1970s writing code for VAXes, I was moved to look into RMS's suggestion to signal an error when reading "0.0e+NaN" on a VAX. Unfortunately this broke calculator.el - that is, I couldn't load calculator.el (or calculator.elc), as loading signaled an error when it saw the NaN. And even if we removed the NaN from calculator.el (and I suppose, infinities from other .el files), users would run into similar issues with their own code.

So I instead installed the attached patch. On a VAX this approximates infinities and NaNs with extremal values and non-numeric objects, respectively. Although I do not have a VAX to test it on, and am too lazy to spin up an emulator, I did test it on x86-64 by pretending that the x86-64 lacked IEEE support, and it seemed to work OK. (At least, I could load calculator.el....)

This patch shouldn't change behavior (or even the executable code) on today's platforms. It's purely for computer museums.

Attachment: 0001-Port-NaN-infinity-handling-better-to-VAX.patch
Description: Text Data


reply via email to

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