all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#60895: Make lambda warning easier to understand
@ 2023-01-17 22:50 Dan Jacobson
  2023-01-17 23:25 ` Drew Adams
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Jacobson @ 2023-01-17 22:50 UTC (permalink / raw)
  To: 60895

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

please also say
   Just change '(lambda into #'(lambda

That way people will understand it.
https://emacs.stackexchange.com/questions/74318/warning-quoted-with-rather-than-with





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#60895: Make lambda warning easier to understand
  2023-01-17 22:50 bug#60895: Make lambda warning easier to understand Dan Jacobson
@ 2023-01-17 23:25 ` Drew Adams
  0 siblings, 0 replies; 2+ messages in thread
From: Drew Adams @ 2023-01-17 23:25 UTC (permalink / raw)
  To: Dan Jacobson, 60895@debbugs.gnu.org

> After saying
>    Warning: (lambda nil \.\.\.) quoted with ' rather than with #'
> 
> please also say
>    Just change '(lambda into #'(lambda
> 
> That way people will understand it.
> https://urldefense.com/v3/__https://emacs.stackexchange.com/questions/743
> 18/warning-quoted-with-rather-than-
> with__;!!ACWV5N9M2RV99hQ!IsLX9TB5zcLT0PwRzmL0cCiiGzx62LVQbGMPk3EiStP6kJvG
> Um6D1reVbucpBxlw8r6g-KjbeT19F7SFjA$

Users should be told, so they understand:

1. Not to quote lambdas.  Tell them that the result
   is a _list_, which only in some cases will be
   interpreted as a function.  (And mention that the
   byte compiler often can't know the intended use
   is as a function, if it's quoted.)

2. lambdas don't need to be quoted - they're
   self-evaluating in Elisp - like t and nil.

3. Using #' makes the intention/use clear for all,
   including the byte-compiler.

A byte-compiler warning is appropriate.  Preferably
it would also point you to doc explaining this in
more detail in the Elisp manual.






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-17 23:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-17 22:50 bug#60895: Make lambda warning easier to understand Dan Jacobson
2023-01-17 23:25 ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.