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 09:28:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier wrote:

>> Only it is not relevant to macro or function that is
>> documented to work, but then again it gives warnings for
>> `n' and not for `return' as in above example.
>
> Not sure what you mean by "documented", but `C-h f dotimes` says:
>
>     dotimes is a Lisp macro in ‘subr.el’.
>
>     (dotimes (VAR COUNT [RESULT]) BODY...)
>
>       Probably introduced at or before Emacs version 21.1.
>
>     Loop a certain number of times. Evaluate BODY with VAR
>     bound to successive integers running from 0, inclusive,
>     to COUNT, exclusive.
>
>     Finally RESULT is evaluated to get the return value (nil
>     if RESULT is omitted). Using RESULT is deprecated, and
>     may result in compilation warnings about
>     unused variables.
>
> Notice the last sentence.

If the byte compiler says this guy has a problem with this
function, and this isn't so, then the actual problem is with
the byte compiler.

Question: When these features are removed for real and for
good from them functions, does that mean the byte compiler
problem will never appear again?

Question 2: Why is this problem so difficult to solve at its
source? What's with these functions that enables them to
cloak, if you will, so the byte compiler cannot se what the
human eye can see instantly, looking at the same material?

-- 
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]