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: Eli Zaretskii
Subject: bug#52063: 28.0.60; Confusing presentation of lambda
Date: Wed, 24 Nov 2021 21:53:33 +0200

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: larsi@gnus.org,  52063@debbugs.gnu.org
> Date: Wed, 24 Nov 2021 14:06:37 -0500
> 
> > So this issue is specific to hooks?
> 
> No, but in 99% of the cases you won't actually *see* a function value
> (unless you specifically go looking for it, e.g. with `symbol-function`).

We also have gobs of variables that are not hooks, which accept
function values.  And we also have menu items and mode-line constructs
that sometimes use anonymous functions.  And timer functions.  And
process filter and sentinel functions.  And that's just 5 sec of
thinking where one could meet them.

> So you'll only get a value of the form (lambda ARGS . BODY) if you use
> the dynamically scoped dialect of ELisp (or if you manually create such
> a list, e.g. with '(lambda ...) or `(lambda ...) or (list 'lambda ...),
> etc...).

So I guess the warning about quoting lambdas with ' instead of #' is
actually misleading people into getting these closures instead of the
lambdas they might expect?  Because that is how this started for me:
during startup Emacs said:

 .emacs: Warning: (lambda nil \.\.\.) quoted with ' rather than with #'

So why do we emit those warnings for Lisp code evaluated from a file
that doesn't have lexical-binding setting in it?  If it were not for
this warning, I'd have never tried using #', and thus would have never
bumped into this curiosity.





reply via email to

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