unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31641: 26.1; iter-do variable not left unused warning
@ 2018-05-29 13:12 Christopher Wellons
  2018-05-29 22:13 ` Noam Postavsky
  0 siblings, 1 reply; 8+ messages in thread
From: Christopher Wellons @ 2018-05-29 13:12 UTC (permalink / raw)
  To: 31641

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





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

end of thread, other threads:[~2021-02-06 10:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-29 13:12 bug#31641: 26.1; iter-do variable not left unused warning Christopher Wellons
2018-05-29 22:13 ` 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

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).