Subject: bug#26960: 26.0.50; Complaints about unused variable in cl-destructuring-bind

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 09 May 2022 11:25:38 +0200

Stefan Monnier <[email-masked]> writes:

> Indeed.  If you look at the macroexpanded code, you see that
> `cl-destructuring-bind` uses:
>
>     (let* ((_ '(1 2))
>            (a _)
>            (b (if _ (pop _)
>                 (signal 'wrong-number-of-arguments
>                         (list '(&whole a b &rest _) (length _))))))
>       (print (list a b)))
>
> so, you can see that the problem is that `cl-destructuring-bind` tries
> to avoid using gensym and "abuses" the &rest var as the "iterator"
> variable while parsing the list.

Hm, right.

I had a quick peek at `cl--do-arglist' (which I guess is what's creating
this form), and...  I think I'll leave this for somebody else to fix.  🫠

In any case, I'm unmerging these two bug reports, and closing the one
that's fixed.

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