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

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

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


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

Jean Louis wrote:

>>> What we talk is return value in third place of `(dolist
>>> (first second third))' and it is strange that if return
>>> value is asked from `dolist' that then the `first' one is
>>> warned about.
>> 
>> The third arg is different from "the expression after
>> `dotimes`" in one important respect: the third arg can
>> refer to the iteration variable which will contain the
>> "last" value:
>> 
>>     (dotimes (i 10 i) nil)
>> 
>> will return 10.
>> So the warning comes when you use that 3rd arg but without
>> referring to the iteration variable: in that case, you
>> could have put the result *after* `dotimes` rather than
>> putting it in the 3rd arg.
>
> I did not understand it, show me example.

... :D

> Would that example remove compiler warning?

Yes.

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