[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#15326: 24.3; Incorrect "variable not left unused" in destructuring c
From: |
Christopher Wellons |
Subject: |
bug#15326: 24.3; Incorrect "variable not left unused" in destructuring cl-loop |
Date: |
Wed, 11 Sep 2013 00:47:54 -0400 |
User-agent: |
Notmuch/0.16 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) |
Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
> A `setq' does not *use* a variable. It just sets it, affecting
> later uses.
I mean that the compiler counts the setq as a use even in this simple
expression:
(let (_)
(setq _ t))
;; Warning: variable `_' not left unused
> If there's no later uses, the setq is just a no-op.
Without bothering to dig into the bytecode for it, it seems that the
compiler is still emitting code for the setq:
(defun foo ()
(let (_)
(setq _ t)))
(defun bar ()
(let (_)))
(equal (byte-compile 'foo)
(byte-compile 'bar))
;; => nil
Maybe I'm not understanding what you mean by "no-op" here.