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

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

bug#8711: 24.0.50; binding _ to unused values with lexical-binding


From: Lawrence Mitchell
Subject: bug#8711: 24.0.50; binding _ to unused values with lexical-binding
Date: Mon, 23 May 2011 10:01:04 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)

Helmut Eller wrote:
> There seems be no way to avoid a warning in code like this:

> ;; -*- lexical-binding: t -*-
> (eval-when-compile (require 'cl))
> (defun foo (x) (destructuring-bind (_) x))
> (defun bar (x) (destructuring-bind (_) x (ignore _)))

> In foo the compiler complains because _ is never used and
> it bar it complains because it is used.

This latter is because cconv-analyse-use is not smart enough when
checking for use of variables starting with an underscore.

;; -*- lexical-binding: t -*-

(let ((_ nil))
  (ignore _))

=>

Warning: variable `_' not left unused.

This despite ignore not touching it.

Lawrence
-- 
Lawrence Mitchell <wence@gmx.li>






reply via email to

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