Subject: bug#52063: 28.0.60; Confusing presentation of lambda

From: Gregory Heytings <[email-masked]>
Date: Wed, 24 Nov 2021 22:37:53 +0000

>> I'm annoyed by this misfeature.  If it means nothing to you and others, 
>> so be it.
>
> I fully understand desire to see function values printed as much as 
> possible as their original source code, but it's hard to reconcile this 
> with the needs of clean semantics, efficient execution, good code 
> analysis, ...
>

AFAIU, the fundamental question here is: is "(closure (t) args body)" 
different in any way from "(lambda args body)"?  If not, is there a good 
reason to use a "(closure (t)" instead of a "(lambda"?

FWIW, I'm running an Emacs with the following patch right now, which 
apparently breaks a couple of edebug tests in make check.  Apart from 
that, it seems that it doesn't change anything in the way Emacs behaves.

diff --git a/src/eval.c b/src/eval.c
index 94ad060773..5d02cabaf4 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -564,6 +564,8 @@ DEFUN ("function", Ffunction, Sfunction, 1, UNEVALLED, 
0,
      xsignal2 (Qwrong_number_of_arguments, Qfunction, Flength (args));

    if (!NILP (Vinternal_interpreter_environment)
+      && !(EQ (Fcar (Vinternal_interpreter_environment), Qt) &&
+          NILP (Fcdr (Vinternal_interpreter_environment)))
        && CONSP (quoted)
        && EQ (XCAR (quoted), Qlambda))
      { /* This is a lambda expression within a lexical environment;