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

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

bug#8711: bug#26960: 26.0.50; Complaints about unused variable in cl-des


From: Lars Ingebrigtsen
Subject: bug#8711: bug#26960: 26.0.50; Complaints about unused variable in cl-destructuring-bind
Date: Sun, 08 May 2022 14:33:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Helmut Eller <eller.helmut@gmail.com> writes:

> 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.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I can reproduce this in Emacs 25.1, but not in Emacs 29.  That is,
there's no warning for `foo'.  There's still a warning for `bar', but
that's correct, isn't it?  `ignore' is just a normal function, so _ is
used there.

However, this example from a merged bug report is giving a warning:

> ;;; -*- lexical-binding: t; -*-
> (require 'cl-lib)
> (cl-destructuring-bind (&whole a b &rest _) '(1 2)
>   (print (list a b)))

And that seems like a bug?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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