unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: 50136@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#50136: 28.0.50; A problem with rx-let expansion
Date: Mon, 23 Aug 2021 12:45:41 +0200	[thread overview]
Message-ID: <87a6l84ey2.fsf@web.de> (raw)
In-Reply-To: <3541B092-BD63-4610-BDA8-A43ABD4FAF6D@acm.org> ("Mattias Engdegård"'s message of "Sat, 21 Aug 2021 15:02:47 +0200")

Mattias Engdegård <mattiase@acm.org> writes:

> Or just put all the actual code in a plain function:
>
> (eval-when-compile
>  (defun expand-my-rx-thing (x y &optional z &rest r) ...))
>
> (rx-define my-rx-thing (x y &rest more) (eval (expand-my-rx-thing x y
> more)))
>
> and use &optional and &rest arguments as you are used to, without any
> risks of substitution accidents like "string" in the example you
> showed earlier. The function would effectively work exactly like a
> macro of the sort you requested.

A good idea, I like it!

> > [... talking about docstring tweaks ...]
>
> I'll see what can be done. It's not really Emacs tradition to have
> examples in doc strings but maybe they can be improved a bit as you
> say.

I you find a way to get along without examples, all the better.  I
suggested to use an example because it might be the simplest way to
explain how things work, and because the way things work may come
unexpected for some (like me).  But providing some more details more
explicitly might be as good as well.


Regards,

Michael.





  reply	other threads:[~2021-08-23 10:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20 13:59 bug#50136: 28.0.50; A problem with rx-let expansion Michael Heerdegen
2021-08-20 14:50 ` Michael Heerdegen
2021-08-20 15:23 ` Mattias Engdegård
2021-08-20 17:21   ` Michael Heerdegen
2021-08-20 18:45     ` Mattias Engdegård
2021-08-21 11:45       ` Michael Heerdegen
2021-08-21 13:02         ` Mattias Engdegård
2021-08-23 10:45           ` Michael Heerdegen [this message]
2021-08-23 12:38             ` Mattias Engdegård
2021-08-23 15:20             ` Mattias Engdegård
2021-08-23 16:59               ` Michael Heerdegen
2021-08-23 18:05                 ` Mattias Engdegård
2021-08-21  3:21     ` Richard Stallman

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=87a6l84ey2.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=50136@debbugs.gnu.org \
    --cc=mattiase@acm.org \
    --cc=monnier@iro.umontreal.ca \
    /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).