* dotimes var comiler warning
@ 2016-11-24 12:47 Andreas Röhler
2016-11-24 12:53 ` Joost Kremers
2016-11-24 13:32 ` Michael Heerdegen
0 siblings, 2 replies; 7+ messages in thread
From: Andreas Röhler @ 2016-11-24 12:47 UTC (permalink / raw)
To: Help Gnu Emacs mailing list
Hallo,
when employing a form
(dotimes (i erg)
...do-something
Compiler sends a warning "Unused lexical variable ‘i’ - whilst seems no
way to leave out such a var.
Worth a bug-report?
Thanks,
Andreas
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dotimes var comiler warning
2016-11-24 12:47 dotimes var comiler warning Andreas Röhler
@ 2016-11-24 12:53 ` Joost Kremers
2016-11-24 13:59 ` Andreas Röhler
2016-11-24 13:32 ` Michael Heerdegen
1 sibling, 1 reply; 7+ messages in thread
From: Joost Kremers @ 2016-11-24 12:53 UTC (permalink / raw)
To: Andreas Röhler; +Cc: Help Gnu Emacs mailing list
On Thu, Nov 24 2016, Andreas Röhler wrote:
> when employing a form
>
> (dotimes (i erg)
>
> ...do-something
>
>
> Compiler sends a warning "Unused lexical variable ‘i’ - whilst
> seems no
> way to leave out such a var.
This seems to work:
(dotimes (_ erg)
...)
(info "(elisp) Using Lexical Binding") says:
,----
| (To silence byte-compiler warnings about unused variables,
just use a
| variable name that start with an underscore. The byte-compiler
| interprets this as an indication that this is a variable known
not to be
| used.)
`----
(Very bottom of the page)
HTH
--
Joost Kremers
Life has its moments
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dotimes var comiler warning
2016-11-24 12:47 dotimes var comiler warning Andreas Röhler
2016-11-24 12:53 ` Joost Kremers
@ 2016-11-24 13:32 ` Michael Heerdegen
2016-11-24 14:14 ` Andreas Röhler
2016-11-24 20:51 ` Emanuel Berg
1 sibling, 2 replies; 7+ messages in thread
From: Michael Heerdegen @ 2016-11-24 13:32 UTC (permalink / raw)
To: Andreas Röhler; +Cc: Help Gnu Emacs mailing list
Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
> when employing a form
>
> (dotimes (i erg)
>
> ...do-something
>
>
> Compiler sends a warning "Unused lexical variable ‘i’ - whilst seems
> no way to leave out such a var.
>
> Worth a bug-report?
If none exists yet, I'm for it. FWIW, there is a FIXME comment in the
source code already.
Yes, you can probably use `_' to suppress the warning, but I always
wondered why something called like this requires a variable to be
specified (mandatorily) at all.
Michael.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dotimes var comiler warning
2016-11-24 12:53 ` Joost Kremers
@ 2016-11-24 13:59 ` Andreas Röhler
0 siblings, 0 replies; 7+ messages in thread
From: Andreas Röhler @ 2016-11-24 13:59 UTC (permalink / raw)
To: Joost Kremers; +Cc: Help Gnu Emacs mailing list
On 24.11.2016 13:53, Joost Kremers wrote:
>
> On Thu, Nov 24 2016, Andreas Röhler wrote:
>> when employing a form
>>
>> (dotimes (i erg)
>>
>> ...do-something
>>
>>
>> Compiler sends a warning "Unused lexical variable ‘i’ - whilst seems
>> no way to leave out such a var.
>
> This seems to work:
>
> (dotimes (_ erg)
> ...)
>
> (info "(elisp) Using Lexical Binding") says:
>
> ,----
> | (To silence byte-compiler warnings about unused variables,
> just use a
> | variable name that start with an underscore. The byte-compiler
> | interprets this as an indication that this is a variable known not
> to be
> | used.)
> `----
>
> (Very bottom of the page)
>
> HTH
>
>
Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dotimes var comiler warning
2016-11-24 13:32 ` Michael Heerdegen
@ 2016-11-24 14:14 ` Andreas Röhler
2016-12-01 23:08 ` Emanuel Berg
2016-11-24 20:51 ` Emanuel Berg
1 sibling, 1 reply; 7+ messages in thread
From: Andreas Röhler @ 2016-11-24 14:14 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: Help Gnu Emacs mailing list
On 24.11.2016 14:32, Michael Heerdegen wrote:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
>> when employing a form
>>
>> (dotimes (i erg)
>>
>> ...do-something
>>
>>
>> Compiler sends a warning "Unused lexical variable ‘i’ - whilst seems
>> no way to leave out such a var.
>>
>> Worth a bug-report?
> If none exists yet, I'm for it. FWIW, there is a FIXME comment in the
> source code already.
>
> Yes, you can probably use `_' to suppress the warning, but I always
> wondered why something called like this requires a variable to be
> specified (mandatorily) at all.
>
>
> Michael.
Done, thanks. It's #25017
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dotimes var comiler warning
2016-11-24 13:32 ` Michael Heerdegen
2016-11-24 14:14 ` Andreas Röhler
@ 2016-11-24 20:51 ` Emanuel Berg
1 sibling, 0 replies; 7+ messages in thread
From: Emanuel Berg @ 2016-11-24 20:51 UTC (permalink / raw)
To: help-gnu-emacs
Michael Heerdegen <michael_heerdegen@web.de> writes:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
>> when employing a form
>> (dotimes (i erg)
>> ...do-something
>>
>> Compiler sends a warning "Unused lexical variable
>> ‘i’ - whilst seems no way to leave out such a var.
>> Worth a bug-report?
>
> If none exists yet, I'm for it. FWIW, there is
> a FIXME comment in the source code already.
>
> Yes, you can probably use `_' to suppress the
> warning, but I always wondered why something called
> like this requires a variable to be specified
> (mandatorily) at all.
What about:
(cl-loop do (message "High Five") repeat 4)
?
--
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
- so far: 26 Blogomatic articles -
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: dotimes var comiler warning
2016-11-24 14:14 ` Andreas Röhler
@ 2016-12-01 23:08 ` Emanuel Berg
0 siblings, 0 replies; 7+ messages in thread
From: Emanuel Berg @ 2016-12-01 23:08 UTC (permalink / raw)
To: help-gnu-emacs
Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>>> when employing a form
>>>
>>> (dotimes (i erg)
>>>
>>> ...do-something
>>>
>>>
>>> Compiler sends a warning "Unused lexical variable
>>> ‘i’ - whilst seems no way to leave out such a var.
>>>
>>> Worth a bug-report? If none exists yet, I'm for
>>> it. FWIW, there is a FIXME comment in the source
>>> code already.
>>
>> Yes, you can probably use `_' to suppress the
>> warning, but I always wondered why something called
>> like this requires a variable to be specified
>> (mandatorily) at all.
>>
>> Michael.
>
> Done, thanks. It's #25017
What about:
(cl-loop do (message "High Five") repeat 4)
?
--
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
- so far: 26 Blogomatic articles -
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-12-01 23:08 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-24 12:47 dotimes var comiler warning Andreas Röhler
2016-11-24 12:53 ` Joost Kremers
2016-11-24 13:59 ` Andreas Röhler
2016-11-24 13:32 ` Michael Heerdegen
2016-11-24 14:14 ` Andreas Röhler
2016-12-01 23:08 ` Emanuel Berg
2016-11-24 20:51 ` Emanuel Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).