Subject: bug#15326: closed (Re: bug#15326: 24.3; Incorrect "variable not left unused" in destructuring cl-loop)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 28 Sep 2013 01:09:05 +0000

Your bug report

#15326: 24.3; Incorrect "variable not left unused" in destructuring cl-loop

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
15326: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15326
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#15326: 24.3; Incorrect "variable not left unused" in destructuring cl-loop
From: Stefan Monnier <[email-masked]>
To: Christopher Wellons <[email-masked]>
Cc: [email-masked]
Date: Fri, 27 Sep 2013 21:08:53 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

I have just installed a patch into trunk which changes the code
generated by `cl-loop' such that this warning should not appear
any more.

        Stefan

Subject: 24.3; Incorrect "variable not left unused" in destructuring cl-loop
From: Christopher Wellons <[email-masked]>
To: [email-masked]
Date: Tue, 10 Sep 2013 14:25:33 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

The byte compiler emits an invalid warning about used "_" lexical
variables in cl-loop destructuring bindings. This was casually mentioned
in bug#8711, where destructuring-bind was fixed (presumably, since it's
fine now) but not loop.

Create a source file like so,

    ;;; -*- lexical-binding: t; -*-
    (require 'cl-lib)
    (cl-loop for (_ value) in '((a 1) (b 2))
             collect value)

Then compile,

    $ emacs -Q -batch -f batch-byte-compile tmp.el
    In toplevel form:
    tmp.el:3:1:Warning: variable `_' not left unused
    Wrote /tmp/tmp.elc

In the macro expansion, the _ is declared in a `let', then later set
with `setq', "using" it.

In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.2)
 of 2013-06-25 on sochi, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
System Description:	Debian GNU/Linux unstable (sid)

Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars'
 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
 'LDFLAGS=-Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''