GNU bug report logs -
#65344
28.2; Unable to Edebug cl-flet form which uses argument destructuring
Previous Next
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
View this message in rfc822 format
On 18.08.23 01:07, Michael Heerdegen wrote:
> Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
>
>> Not remembering much about Edebug, but cl-defun seems to work with
>> Edebug. So... :-)
>
> Yes, this problem does not concern `cl-defun'. This is the Edebug spec
> of `cl-flet':
>
> #+begin_src emacs-lisp
> ((&rest [&or (symbolp form)
> (&define [&name symbolp "@cl-flet@"]
> [&name [] gensym] ;Make it unique!
> cl-lambda-list
> cl-declarations-or-string
> [&optional ("interactive" interactive)]
> def-body)])
> cl-declarations body)
> #+end_src
>
> Instrumenting a binding first tries (symbolp form): This is the syntax
> where you can specify an expression to evaluate whose result is then
> fbound. Although we obviously have three elements to match in the
> recipe case, Edebug tries nonetheless, and FORM raises an error because
> it can't match ((min max)). It should just cause backtracking, but the
> implementation disables backtracking by purpose.
>
> When you replace (symbolp form) with (symbolp sexp) the problem is gone.
> But that only silences the problem: this also disables the
> instrumentation of a form in that position.
>
> I'm too dumb to fix this correctly. We could transpose the two &or
> branches in the spec, this works but it is also only a way to avoid the
> problem.
Thanks.
The corresponding declaration of cl-defun is
(&define [&name sexp] ;Allow (setf ...) additionally to symbols.
cl-lambda-list
cl-declarations-or-string
[&optional ("interactive" interactive)]
def-body)
which I would naively expect to be suitable for a single function in an
flet/labels. (Maybe without the (setf ...) case, I'm not sure ATM).
Do you perhaps have an insight why there are two &name in the flet spec?
Also naively asked, what does the &or in the flet case mean? Does it
say that that the elements of the flet can either be symbols or
functions? A symbol element doesn't make much sense to me. Do you
perhaps have a clue what that is?
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.