all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#71120: 29.3; buglet in cl-loop
@ 2024-05-22  8:43 Philippe Schnoebelen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-05-29 20:47 ` Philip Kaludercic
  0 siblings, 1 reply; 19+ messages in thread
From: Philippe Schnoebelen via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-05-22  8:43 UTC (permalink / raw)
  To: 71120

When I need a list of 100 random dice throws I write

	(cl-loop for i from 1 to 100 collect (random 6))

It compiles just fine.

If instead I use

	(cl-loop for _i from 1 to 100 collect (random 6))

then I get a compilation warning:

	foo.el:1:18: Warning: variable ‘_i’ not left unused

It should be the other way around.

The variable 'i' is unused in the first form and that deserves a warning 
at compile time. Otherwise the compiler will not help me catch the typo in

	(cl-loop for i from 0 to 10 do
	   (cl-loop for j from 0 to 10 do
	      (foo j j))) ;; <<<=== typo, I meant (foo i j)


--ph.schnoebelen, happy and thankful GNU Emacs user since 1983 (Thanks 
to all involved!!)






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

end of thread, other threads:[~2024-06-03 16:24 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-22  8:43 bug#71120: 29.3; buglet in cl-loop Philippe Schnoebelen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-29 20:47 ` Philip Kaludercic
2024-05-29 21:33   ` Andrea Corallo
2024-05-29 21:49     ` Andrea Corallo
2024-05-30  1:45     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-30  9:25   ` Mattias Engdegård
2024-05-30 13:14     ` Andrea Corallo
2024-05-30 14:51       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-30 15:41         ` Andrea Corallo
2024-05-30 15:45           ` Mattias Engdegård
2024-05-30 17:15             ` Andrea Corallo
2024-05-30 17:18               ` Mattias Engdegård
2024-05-30 17:42                 ` Andrea Corallo
2024-05-31  4:30                   ` Gerd Möllmann
2024-05-31  8:29                   ` Mattias Engdegård
2024-06-03 15:24                     ` Andrea Corallo
2024-06-03 15:32                       ` Mattias Engdegård
2024-06-03 15:42                         ` Andrea Corallo
2024-06-03 16:24                           ` Mattias Engdegård

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.