GNU bug report logs - #52063
28.0.60; Confusing presentation of lambda

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Tue, 23 Nov 2021 18:57:02 UTC

Severity: normal

Found in version 28.0.60

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 52063 <at> debbugs.gnu.org, Philipp Stephani <p.stephani2 <at> gmail.com>,
 Filipp Gunbin <fgunbin <at> fastmail.fm>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#52063: 28.0.60; Confusing presentation of lambda
Date: Fri, 26 Nov 2021 13:28:25 +0100
Jim Porter <jporterbugs <at> gmail.com> writes:

> It might be nice to print an empty arglist as "()" instead of "nil"
> too. While both of those are equivalent, I think "()" is more
> idiomatic when showing an arglist. Currently we have:
>
>   (lambda () (setq foo 1))
>   ;; => (closure (t) nil (setq foo 1))

The printer used here is a general Lisp printer, and doesn't know
anything about the semantics.  (And I don't think we can change that.)
But Emacs 29 has a language-aware pp variant, which does what you
suggest:

(lambda () 'foo)
=> (closure (t) nil 'foo)

(pp-emacs-lisp-code '(closure (t) nil 'foo))
=> (closure (t) ()
     'foo)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 254 days ago.

Previous Next


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