unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Dan Jacobson <jidanni@jidanni.org>,
	"60895@debbugs.gnu.org" <60895@debbugs.gnu.org>
Subject: bug#60895: Make lambda warning easier to understand
Date: Tue, 17 Jan 2023 23:25:29 +0000	[thread overview]
Message-ID: <CO6PR10MB54731F5D1AECE8F9C5FC8B3CF3C69@CO6PR10MB5473.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87h6wowzb7.5.fsf@jidanni.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.






      reply	other threads:[~2023-01-17 23:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 22:50 bug#60895: Make lambda warning easier to understand Dan Jacobson
2023-01-17 23:25 ` Drew Adams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO6PR10MB54731F5D1AECE8F9C5FC8B3CF3C69@CO6PR10MB5473.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=60895@debbugs.gnu.org \
    --cc=jidanni@jidanni.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).