Subject: Re: bug#16206: 24.3; Incorrect unused variable byte-compiler warning in dotimes

From: Stefan Monnier <[email-masked]>
Date: Sun, 22 Dec 2013 21:48:50 -0500

> When `lexical-binding' is t the byte-compiler issues an invalid warning
> for `dotimes' when the optional "result" form is used. For example,
> byte-compile a file with these contents.

>     ;;; -*- lexical-binding: t; -*-
>     (defun foo ()
>       (dotimes (i 1 t) i))

Indeed.  This is a known problem.  I strongly recommend you don't use
this third argument unless it makes use of `i' (which is basically the
only case where it's useful, AFAIK).

IOW use

   (defun foo ()
     (dotimes (i 1) i)
     t)

-- Stefan