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

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

Now I do notice it.

I do switch to `while' and mapping functions rather.

Jean



reply via email to

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