GNU bug report logs - #65344
28.2; Unable to Edebug cl-flet form which uses argument destructuring

Previous Next

Package: emacs;

Reported by: Brandon Irizarry <brandon.irizarry <at> gmail.com>

Date: Wed, 16 Aug 2023 18:23:02 UTC

Severity: normal

Found in version 28.2

Fixed in version 30.1

Done: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 65344 <at> debbugs.gnu.org (full text, mbox):

From: Brandon Irizarry <brandon.irizarry <at> gmail.com>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: 65344 <at> debbugs.gnu.org
Subject: Re: bug#65344: 28.2; Unable to Edebug cl-flet form which uses
 argument destructuring
Date: Thu, 17 Aug 2023 11:42:06 -0400
[Message part 1 (text/plain, inline)]
Destructured lambda-lists appear to be an Elisp extension to Common Lisp's
argument notation,
and the Emacs docs do mention them (though not in the Elisp manual; rather,
it's in the CL-Lib manual).
They even mention your point about such a lambda-list not being valid
Common Lisp.

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.

- Brandon

On Thu, Aug 17, 2023 at 1:29 AM Gerd Möllmann <gerd.moellmann <at> gmail.com>
wrote:

> > (cl-flet ((fn ((min max))
> >      (message "%d %d" min max)))
> >   (fn '(2 3)))
> >
> > The cl-flet form evaluates fine (e.g. with C-x C-e or C-M-x), which
> > leads me to conclude that this construct is legal.
>
> I think this lambda-list is invalid.  It certainly is invalid in CL, and
> I can't find any extension mentioned in the Emacs docs.
>
> Why this doesn't signal an error at evaluation time, I don't know.  If
> you try this with defun, you get an error.
>
[Message part 2 (text/html, inline)]

This bug report was last modified 1 year and 261 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.