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 #113 received at 52063 <at> debbugs.gnu.org (full text, mbox):

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

> Or maybe we could just _print_ the closure objects in such a special
> way that it's more pleasant to read, especially when there's actually
> empty lexical environment.

(pp-emacs-lisp-code (lambda () (setq foo bar) (setq foo bar)))
=>
(closure
 (t)
 nil
 (setq foo bar)
 (setq foo bar))

Slightly less confusing, but perhaps it should be

(closure (t) nil
  (setq foo bar)
  (setq foo bar))

Depends on the length of the lexical list, though:

(pp-emacs-lisp-code
 (let ((bar 1))
   (lambda (f) (setq foo bar) (setq foo bar))))
=>
(closure ((bar . 1) t) (f)
  (setq foo bar)
  (setq foo bar))

can be unwieldy if the list is long.

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