[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compiler warning
From: |
Noam Postavsky |
Subject: |
Re: Compiler warning |
Date: |
Wed, 18 Jul 2018 07:48:26 -0400 |
On 18 July 2018 at 07:38, Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:
> get a strange
>
> Warning: Unused lexical variable ‘i’
>
> refering to this:
>
> (defun py-forward-block (&optional arg decorator bol)
> "[...]"
> (interactive "p")
> (let (erg)
> (dotimes (i (or arg 1))
> (let ((orig (point)))
> (setq erg (py--end-base 'py-block-re orig decorator bol))))
You haven't use `i', so the warning seems fitting. Use `_' instead of
`i' to tell the compiler the variable is ignored on purpose.
> While code below compiles without warning:
>
> (defun foo (&optional arg)
> (interactive "p")
> (dotimes (i (or arg 1))
> (insert "Me again\n")))
Did you compile this one without lexical-binding?
- Compiler warning, Andreas Röhler, 2018/07/18
- Re: Compiler warning,
Noam Postavsky <=