unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Gemini Lasswell <gazally@runbox.com>
Cc: 28747@debbugs.gnu.org
Subject: bug#28747: 26.0.60; Usage of "&rest body" in Edebug specs
Date: Wed, 16 Oct 2019 04:45:40 +0200	[thread overview]
Message-ID: <87sgnto1bf.fsf@gnus.org> (raw)
In-Reply-To: <87o9phznq7.fsf@runbox.com> (Gemini Lasswell's message of "Sun, 08 Oct 2017 08:02:56 -0700")

Gemini Lasswell <gazally@runbox.com> writes:

> The symbol &rest in an Edebug spec has a different meaning than it has
> in an argument list. In particular, "&rest body" in an Edebug spec is
> erroneous usage because it is asking Edebug to match something that
> can match nothing (body) as many times as it can, which makes an
> infinite loop.

[...]

> Here are the macros I've found that have this incorrect usage of &rest
> in their Edebug specs:
>
> crm--completion-command
> easy-mmode-define-navigation
> inline--letlisteval
> inline--leteval
> ses--letref

I've now fixed these.

> Edebug specs have been using &rest for a really long time and it
> mostly gets used correctly. But &repeat would be better, since it
> actually describes the functionality and doesn't have a completely
> different and more common usage in argument lists.
>
> Here's a little example of what an Edebug spec would look like with
> &repeat in place of &rest:
>
> (defmacro msgmac (&rest args)
>   (declare (debug ("start" [&repeat "middle"] "end")))
>   `(message "%s" ',args))
>
> (defun use-msgmac ()
>   (msgmac start end)
>   (msgmac start middle end)
>   (msgmac start middle middle end))
>
> Does anyone have thoughts on the idea of adding &repeat as a synonym
> for &rest in Edebug specs, with the goal of moving &rest towards
> obsolescence eventually?

I agree that this would be a lot clearer and probably less error-prone
than &rest.

Does anybody have an opinion here?

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





  parent reply	other threads:[~2019-10-16  2:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-08 15:02 bug#28747: 26.0.60; Usage of "&rest body" in Edebug specs Gemini Lasswell
2017-10-13  0:54 ` Noam Postavsky
2019-10-16  2:45 ` Lars Ingebrigtsen [this message]
2019-10-18  3:12   ` Richard Stallman
2019-10-18  3:35     ` Lars Ingebrigtsen
2019-10-18 14:14       ` Richard Stallman
2019-10-19  8:20         ` Lars Ingebrigtsen
2019-10-19 14:02   ` Michael Heerdegen
2022-01-29 15:56   ` Lars Ingebrigtsen
2022-02-01  5:03     ` Richard Stallman
2022-01-29 23:25 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-31  2:21   ` Lars Ingebrigtsen
2022-01-31  2:30     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-31  2:35       ` Lars Ingebrigtsen
2022-01-31  2:44         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-31  3:00           ` Lars Ingebrigtsen
2022-05-01  8:49             ` Lars Ingebrigtsen

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=87sgnto1bf.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=28747@debbugs.gnu.org \
    --cc=gazally@runbox.com \
    /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).