all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: 58727@debbugs.gnu.org
Subject: bug#58727: 29.0.50; rx doc: Semantics of RX...
Date: Mon, 24 Oct 2022 04:34:09 +0200	[thread overview]
Message-ID: <87pmeic5lq.fsf@web.de> (raw)
In-Reply-To: <3BB74199-7826-41F5-96BA-39CB3EC0E2B7@gmail.com> ("Mattias Engdegård"'s message of "Sun, 23 Oct 2022 18:14:10 +0200")

Mattias Engdegård <mattias.engdegard@gmail.com> writes:

> > The resulting regexps are concatenating like with an implicit `seq'.
> > This is not trivial, though: in stringish regexps the repetition
> > operators are only unary, and different interpretations would make sense
> > for `rx' (implicit `seq', implicit `or').
>
> The rule is implicit concatenation unless specified otherwise; maybe
> we could say that in the leading paragraph. (`or` is the only place
> where concatenation isn't done.)

Yes, that would be good.


> > Oh, and maybe let's also make more clear that `rx' always cares
> > about implicit grouping when necessary.
>
> No, there is no such thing in rx.

I think you misunderstood what I meant, I meant the implicit shy
grouping added in the return value, as in

  (rx (or "ab" "cd")) ==> "\\(?:ab\\|cd\\)"
                           ^^^^^       ^^^
> The manual provides corresponding string-notation constructs for
> orientation only.  This is important -- rx forms are defined by their
> semantics, not by what strings they translate to.

Is this trivial however?  Is it clear that, even for people that see rx
more as a translator to stringish regexps, `rx' is that smart?

A sentence like "rx forms are defined by their semantics" would help to
make that clear I think.
Dunno, I'm just guessing that here is a potential for misunderstanding.

Telling about the implicit concatenation of RX... is the more important
point for me.


Thanks so far,

Michael. 





  reply	other threads:[~2022-10-24  2:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-23  2:32 bug#58727: 29.0.50; rx doc: Semantics of RX Michael Heerdegen
2022-10-23 16:14 ` Mattias Engdegård
2022-10-24  2:34   ` Michael Heerdegen [this message]
2022-10-24 12:49     ` Mattias Engdegård
2022-10-25  2:49       ` Michael Heerdegen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmeic5lq.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=58727@debbugs.gnu.org \
    --cc=mattias.engdegard@gmail.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.