bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#52063: 28.0.60; Confusing presentation of lambda


From: Lars Ingebrigtsen
Subject: bug#52063: 28.0.60; Confusing presentation of lambda
Date: Fri, 26 Nov 2021 13:28:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Jim Porter <jporterbugs@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





reply via email to

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