Subject: bug#65344: 28.2; Unable to Edebug cl-flet form which uses argument destructuring

From: Gerd Möllmann <[email-masked]>
Date: Thu, 17 Aug 2023 20:23:40 +0200

> From the CL-Lib manual, 4.3.2 (Function Bindings):
> 
>      Functions defined by ‘cl-flet’ may use the full Common Lisp
>      argument notation supported by ‘cl-defun’; also, the function body
>      is enclosed in an implicit block as if by ‘cl-defun’.  *Note
>      Program Structure::.
> 
> Following the reference to Chapter 2, and heading into 2.1 (Argument
> Lists):
> 
>    Argument lists support “destructuring”.  In Common Lisp,
> destructuring is only allowed with ‘defmacro’; this package allows it
> with ‘cl-defun’ and other argument lists as well.
> 
> That is, while 'defun' doesn't support this, 'cl-defun' (and, by extension,
> 'cl-flet') does.

Wow, that's nicely hidden.  Thanks for digging that out! I would like to 
nominate this for the obscure feature of the week award.

@Eli:

I can see that implemented in cl--do-arglist, which calls itself 
recursively for such lists like in our case used as function parameters. 
  cl--do-arglist is used (indirectly) by cl-flet, cl-labels, cl-defun, 
maybe others.

cl-defun's doc string even contains has hint

"...The full form of a Common Lisp function argument list is
...
VAR may be replaced recursively with an argument list for
destructuring,,,"

I don't think cl-flet/cl-labels have that.

@Michael:

Not remembering much about Edebug, but cl-defun seems to work with 
Edebug.  So... :-)