From: Brandon Irizarry <brandon.irizarry@gmail.com>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: Michael Heerdegen <michael_heerdegen@web.de>,
65344@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: bug#65344: 28.2; Unable to Edebug cl-flet form which uses argument destructuring
Date: Tue, 22 Aug 2023 17:06:24 -0400 [thread overview]
Message-ID: <CAJm+nuHj7TfVnPHh7cEofiZD5b3xbqWefYGS6on+X_e2ViUdgg@mail.gmail.com> (raw)
In-Reply-To: <m2v8d7pkmk.fsf@Mini.fritz.box>
[-- Attachment #1: Type: text/plain, Size: 2814 bytes --]
Hi all,
First, thanks for all the attention this has received. Eli, your comments
are duly noted.
Trying my best to follow this thread, I took the patch submitted by Gerd,
pasted it in my scratch buffer, renamed the macro 'my-cl-flet', but
switched the order of the two '&define' clauses. I evaluated this macro and
started using it on some small test cases, which check out. I believe I may
merely be echoing Gerd's comment about exchanging the two debug specs, but
I wanted to flesh this aspect out a bit more thoroughly in case. Note that
I've used Org source blocks (which I've noticed people have been doing),
since I suspect people are reading this thread in Emacs itself, and can
subsequently avail themselves of this format.
Under 'emacs -Q':
#+begin_src emacs-lisp
(require 'cl-macs)
;; insert 'my-cl-flet' macro definition here
(my-cl-flet ((cool-fn ((min max))
(cons min max)))
(cool-fn '(2 3)))
#+end_src
Edebug here runs as smooth as butter. Nice!
Next, I tried another example mentioned in this thread:
#+begin_src emacs-lisp
(defun make-fun (n)
(message "the function")
(lambda () n))
(defvar k 17)
(my-cl-flet ((a (make-fun k))) ;; `make-fun' call not instrumented
(a))
#+end_src
Again, everything looks good. Finally, a more conventional example:
#+begin_src emacs-lisp
(my-cl-flet ((fn (a b)
(cons a b)))
(fn 1 2))
#+end_src
Works out, as expected. So it looks like we may have a happy ending after
all?
WDYT?
On Tue, Aug 22, 2023 at 4:05 AM Gerd Möllmann <gerd.moellmann@gmail.com>
wrote:
> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
> > Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> >
> >> I wonder if this isn't a bug in cl-flet itself. If you change the names
> >> a bit, this is
> >>
> >> (cl-flet ((fn (a b)))
> >> ...)
> >>
> >> which is a perfectly valid local definition of FN with two parameter A
> >> and B, returning nil in CL. It signals an error in Emacs which I'd
> >> consider a bug.
> >
> > It's a known limitation, AFAIR. It's more important to support the
> > (SYMBOL EXPR) than this corner case, and we don't want to guess "what is
> > meant", so a binding of two elements is always interpreted this way in
> > Elisp. This problem has been discussed a while ago.
>
> That's quite unfortunate :-(. I wish that whole extension would be at
> least be deprecated.
>
> I'll exchange the two debug specs then. ATM, I don't see how to test
> that though. That's also unfortunate.
>
> > Hmm, right...but where did I see it. Oh, I remember, it was
> > `cl-defmethod' that supports such names.
>
> Looks like it does, indeed, by constructing a symbol. One couldn't tell
> from the doc string :-).
>
[-- Attachment #2: Type: text/html, Size: 4018 bytes --]
next prev parent reply other threads:[~2023-08-22 21:06 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 18:21 bug#65344: 28.2; Unable to Edebug cl-flet form which uses argument destructuring Brandon Irizarry
2023-08-17 0:55 ` Michael Heerdegen
2023-08-17 5:29 ` Gerd Möllmann
2023-08-17 15:42 ` Brandon Irizarry
2023-08-17 15:56 ` Eli Zaretskii
2023-08-17 18:23 ` Gerd Möllmann
2023-08-17 23:07 ` Michael Heerdegen
2023-08-18 5:19 ` Gerd Möllmann
2023-08-18 5:58 ` Michael Heerdegen
2023-08-18 6:43 ` Gerd Möllmann
2023-08-19 8:08 ` Gerd Möllmann
2023-08-20 3:57 ` Michael Heerdegen
2023-08-20 5:32 ` Gerd Möllmann
2023-08-20 6:08 ` Michael Heerdegen
2023-08-20 6:48 ` Gerd Möllmann
2023-08-21 1:19 ` Michael Heerdegen
2023-08-21 7:01 ` Gerd Möllmann
2023-08-21 7:10 ` Gerd Möllmann
2023-08-21 7:30 ` Gerd Möllmann
2023-08-22 0:54 ` Michael Heerdegen
2023-08-22 5:48 ` Gerd Möllmann
2023-08-22 6:10 ` Michael Heerdegen
2023-08-22 8:05 ` Gerd Möllmann
2023-08-22 21:06 ` Brandon Irizarry [this message]
2023-08-23 0:35 ` Michael Heerdegen
2023-08-23 0:32 ` Michael Heerdegen
2023-08-23 1:25 ` Drew Adams
2023-08-23 6:06 ` Gerd Möllmann
2023-08-23 14:23 ` Drew Adams
2023-08-24 3:16 ` Michael Heerdegen
2023-08-24 9:10 ` Gerd Möllmann
2023-08-24 23:04 ` Michael Heerdegen
2023-08-25 1:53 ` Drew Adams
2023-08-25 4:07 ` Michael Heerdegen
2023-08-25 14:50 ` Drew Adams
2023-08-26 0:16 ` Michael Heerdegen
2023-08-26 2:02 ` Drew Adams
2023-08-20 4:39 ` Michael Heerdegen
2023-08-20 5:15 ` Gerd Möllmann
2023-08-23 9:25 ` Mattias Engdegård
2023-08-23 9:31 ` Mattias Engdegård
2023-08-23 11:10 ` Gerd Möllmann
2023-08-23 14:08 ` Gerd Möllmann
2023-08-24 1:14 ` Michael Heerdegen
2023-08-24 6:17 ` Gerd Möllmann
2023-08-25 4:10 ` Michael Heerdegen
2023-08-25 6:19 ` Gerd Möllmann
2023-08-25 4:22 ` Michael Heerdegen
2023-08-25 6:33 ` Gerd Möllmann
2023-08-25 17:53 ` Michael Heerdegen
2023-08-26 5:39 ` Gerd Möllmann
2023-08-27 4:02 ` Michael Heerdegen
2023-08-27 6:34 ` Gerd Möllmann
2023-09-01 23:24 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-02 5:10 ` Gerd Möllmann
2023-09-02 17:04 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-02 19:27 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 5:51 ` Gerd Möllmann
2023-09-03 16:09 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 16:47 ` Gerd Möllmann
2023-09-04 21:14 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-23 9:33 ` Gerd Möllmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJm+nuHj7TfVnPHh7cEofiZD5b3xbqWefYGS6on+X_e2ViUdgg@mail.gmail.com \
--to=brandon.irizarry@gmail.com \
--cc=65344@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=gerd.moellmann@gmail.com \
--cc=michael_heerdegen@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).