unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Wellons <wellons@nullprogram.com>
To: 31641@debbugs.gnu.org
Subject: bug#31641: 26.1; iter-do variable not left unused warning
Date: Tue, 29 May 2018 09:12:30 -0400	[thread overview]
Message-ID: <20180529131230.kijx2bkcvcqsyhgg@nullprogram.com> (raw)

When byte-compiling an iter-do form with a variable intended to be left 
unused, the compiler emits a false warning:

;;; -*- lexical-binding: t; -*-
(require 'generator)
(iter-do (_ i))
;; -> "Warning: variable ‘_’ not left unused"

Giving the variable a name has the opposite effect, though it's not 
a false warning in this case:

(iter-do (v i))
;; -> "Unused lexical variable ‘v’"

This issue does not occur with similar, long-established forms:

;;; -*- lexical-binding: t; -*-
(dolist (_ '(a b c)))
(dotimes (_ 10))
;; -> no warnings





             reply	other threads:[~2018-05-29 13:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 13:12 Christopher Wellons [this message]
2018-05-29 22:13 ` bug#31641: 26.1; iter-do variable not left unused warning Noam Postavsky
2021-02-04 10:05   ` Lars Ingebrigtsen
2021-02-04 16:36     ` Stefan Monnier
2021-02-05  8:53       ` Lars Ingebrigtsen
2021-02-05 15:03         ` Stefan Monnier
2021-02-06 10:31       ` Lars Ingebrigtsen
2021-02-05 17:12     ` Basil L. Contovounesios

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=20180529131230.kijx2bkcvcqsyhgg@nullprogram.com \
    --to=wellons@nullprogram.com \
    --cc=31641@debbugs.gnu.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).