[Top][All Lists]

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

bug#39221: Elisp nil is not a symbol in Elisp

From: Taylan Kammer
Subject: bug#39221: Elisp nil is not a symbol in Elisp
Date: Thu, 13 May 2021 12:22:37 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

Interesting issue.  Was also not fixed in bipt's wip-elisp branch.

Attached is a patch that attempts to fix this, and some related
issues, both for nil and for t.

The strategy is:

1. All Elisp functions we implement in terms of Scheme must be written
   to special-handle #nil and #t if they accept symbols as arguments.
   (Examples: symbolp, symbol-name, set, makunbound)

2. The Elisp function 'intern' must special-handle "nil" and "t".

This patch, to realize nr. 1, turns #nil and #t into the Scheme
symbols 'nil and 't internally in some situations, but makes sure
not to return those symbols, which are of course not equivalent to 
the #nil and #t values.

The Elisp reader already turns nil and t into #nil and #t, but we
should probably also write a custom Elisp writer that writes them
back as nil and t.  I see you have a separate bug report open for
that issue (https://bugs.gnu.org/39220) and I think we can keep the
two issues separate so no attempt to touch on that in this patch.

- Taylan

Attachment: 0001-In-elisp-nil-and-t-are-symbols.patch
Description: Text document

reply via email to

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