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: Jean Louis
Subject: Re: FW: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'?
Date: Fri, 8 Jan 2021 05:39:48 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* Stefan Monnier <monnier@iro.umontreal.ca> [2021-01-08 05:31]:
> > 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.

Would that example remove compiler warning?



reply via email to

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