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

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

bug#16206: 24.3; Incorrect unused variable byte-compiler warning in doti


From: Stefan Monnier
Subject: bug#16206: 24.3; Incorrect unused variable byte-compiler warning in dotimes
Date: Sun, 22 Dec 2013 21:48:50 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> 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





reply via email to

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