help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to avoid compiler warning `unused lexical variable' for `dolist'


From: Emanuel Berg
Subject: Re: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'?
Date: Fri, 08 Jan 2021 02:08:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jean Louis wrote:

>>> The discussion in that bug implies that it won't get
>>> fixed. Probably we should discourage the three-argument
>>> form more strongly, e.g. by removing it from the
>>> documentation and changing the advertised
>>> calling convention.
>> 
>> What about fixing the byte-compiler so it won't warn a used
>> variable is unused? :)
>
> That is what I was thinking, or

Not "or", and :)

> some other way of programming to declare the variable.

Use `cl-loop', the `for' variant, for this.

No manual/explicit "length" business, no byte-compiler issues,
looks and works great.

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]