[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#71120: 29.3; buglet in cl-loop
From: |
Mattias Engdegård |
Subject: |
bug#71120: 29.3; buglet in cl-loop |
Date: |
Thu, 30 May 2024 11:25:46 +0200 |
Philippe Schnoebelen <phs@lmf.cnrs.fr> writes:
> 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
Quite unfair that you have no a priori way of knowing whether your variable
name is actually the one that `cl-loop` uses for iteration or just one bound
for each iteration (as in `dotimes`).
A sloppy reading of Common Lisp's `loop` spec, which we don't need to follow
since this isn't CL but we'd be fools to deviate too far from without a good
reason, didn't tell me anything.
In particular nothing about whether the user is allowed to alter the variable
in order to change the iteration. For example, what should
(cl-loop for i from 1 to 100
when (= i 3) do (setq i 98)
collect i)
return? Perhaps better not touch that.
Thus I don't think there's anything we really need to do here, do you?
- bug#71120: 29.3; buglet in cl-loop, Philippe Schnoebelen, 2024/05/22
- bug#71120: 29.3; buglet in cl-loop, Philip Kaludercic, 2024/05/29
- bug#71120: 29.3; buglet in cl-loop, Andrea Corallo, 2024/05/29
- bug#71120: 29.3; buglet in cl-loop,
Mattias Engdegård <=
- bug#71120: 29.3; buglet in cl-loop, Andrea Corallo, 2024/05/30
- bug#71120: 29.3; buglet in cl-loop, Stefan Monnier, 2024/05/30
- bug#71120: 29.3; buglet in cl-loop, Andrea Corallo, 2024/05/30
- bug#71120: 29.3; buglet in cl-loop, Mattias Engdegård, 2024/05/30
- bug#71120: 29.3; buglet in cl-loop, Andrea Corallo, 2024/05/30
- bug#71120: 29.3; buglet in cl-loop, Mattias Engdegård, 2024/05/30
- bug#71120: 29.3; buglet in cl-loop, Andrea Corallo, 2024/05/30
- bug#71120: 29.3; buglet in cl-loop, Gerd Möllmann, 2024/05/31
- bug#71120: 29.3; buglet in cl-loop, Mattias Engdegård, 2024/05/31