Subject: bug#71120: 29.3; buglet in cl-loop

From: Andrea Corallo <[email-masked]>
Date: Thu, 30 May 2024 11:41:50 -0400

Stefan Monnier <[email-masked]> writes:

>>>> 	(cl-loop for i from 1 to 100 collect (random 6))
> [...]
>>>> 	(cl-loop for _i from 1 to 100 collect (random 6))
>>> Thus I don't think there's anything we really need to do here, do you?
>> I, for one, think the nicest option is the one SBCL (and I guess other
>> CL implementations) are using, that is to have 'i' 'ignorable', the
>> problem is that we don't support this at language level.
>
> I don't quite see how "ignorable" comes into play here.
>
> In the first case above, the var is "not used", has a "normal"
> name, and we get no warning.  Does SBCL do the same or does it emit
> a warning?

It does not emit a warning

> In the second case, the var is "not used", has an "I'm not used" name,
> and we do get a warning.  Does SBCL even support "I'm not used" names?

It does not.

In Elisp a variable can be either normal or _* (not used).

In CL a variable other than normal can be 'ignore' which correspond to
our _* or 'ignorable'.  This last AFAIU stands for might or might not be
used but don't emit warnings.

It's no big deal but I think 'ignorable' is useful for macros expanding
code with variables that might or not be used by the user like in this.

  Andrea