all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: stephen_leake@stephe-leake.org, 21185@debbugs.gnu.org
Subject: bug#21185: 25.0.50; byte-compiler warn on quote lexical var
Date: Thu, 08 Jul 2021 16:12:47 +0200	[thread overview]
Message-ID: <878s2gsxls.fsf@gnus.org> (raw)
In-Reply-To: <jwvk2t9umjs.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Wed, 05 Aug 2015 23:28:52 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I've been bitten by this problem when converting code to use lexical
>> binding; it would be helpful if the byte-compiler warned about it.
>
> Agreed, but I haven't figured out how to make this work.
> There are two problems:
> 1- detect not just things like « 'var » but also things like « '(var1
>    var2 var3) » since such occur in a few places as well.
> 2- don't swamp the user with false positives.
>
> Problem 2 is by far the biggest.  It's very common to have a local
> variable `face' and at the same time to use the symbol `face' (quoted),
> for example.

So the suggestion is to have code like

(let ((foo "bar"))
  (when (zot 'foo)
     ...))

give a warning (in lexical code)?  That does sound useful, especially if
the `zot' here is `bound-and-true-p', which somebody was using in a
different bug report the other week.

But I think that Stefan is totally correct in 2) -- there will be so
many false positives that it won't be useful.  So I'm closing this bug
report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





      parent reply	other threads:[~2021-07-08 14:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04  9:17 bug#21185: 25.0.50; byte-compiler warn on quote lexical var stephen_leake
2015-08-06  3:28 ` Stefan Monnier
2015-08-06  7:15   ` Stephen Leake
2021-07-08 14:12   ` Lars Ingebrigtsen [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

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

  git send-email \
    --in-reply-to=878s2gsxls.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=21185@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stephen_leake@stephe-leake.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 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.