GNU bug report logs -
#52063
28.0.60; Confusing presentation of lambda
Previous Next
Full log
Message #65 received at 52063 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: larsi <at> gnus.org, 52063 <at> 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.
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.