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

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

Re: Idiomatic way to avoid unused lexical variable in ‘dotimes’ or ‘doli


From: tpeplt
Subject: Re: Idiomatic way to avoid unused lexical variable in ‘dotimes’ or ‘dolist’?
Date: Tue, 26 Mar 2024 22:02:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

Stefan Monnier via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

>> 1. Is there an idiom in Emacs Lisp for writing this that
>>    eliminates this warning?
>
>     (dotimes (_ 100)
>       (insert "I will not obey absurd orders\n"))
>
> Or any other var name that starts with an underscore.
>
>
>         Stefan

Thank you.  I have not been able to find this documented anywhere (that
is, that lexical variables whose names begin with an underscore are not
flagged with a warning message if they are not referenced).  This
appears to be true with, for example, ‘let’ expressions, also.

--



reply via email to

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