From: "Mattias Engdegård" <mattiase@acm.org>
To: Noam Postavsky <npostavs@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: New rx implementation with extension constructs
Date: Thu, 5 Sep 2019 18:49:23 +0200 [thread overview]
Message-ID: <0D601D4F-B6CF-44D1-A8C1-28A51EE850A2@acm.org> (raw)
In-Reply-To: <CAM-tV-8jURNdweBRp+wS0U5dARVwUNUsKAOccFWqYDzBeLELMg@mail.gmail.com>
5 sep. 2019 kl. 17.38 skrev Noam Postavsky <npostavs@gmail.com>:
>
> Do you mean that macros don't support (literal LISP-FORM) and (regexp
> LISP-FORM)? Or something else?
No, those work just as before. I just meant that user-defined rx forms work by plain substitution and have no computational power. They are more like C macros than Lisp macros in that respect.
But you are quite right --- `literal', `regexp' or `eval' could be (ab)used to get computing macros, so it isn't really a limitation.
> It would help to add some concrete examples (i.e., of things that
> would count as `t', `seq', etc) to this abstract explanation.
Thanks, will do.
>> +(defun rx--translate-symbol (sym)
>> + "Translate an rx symbol. Return (REGEXP . PRECEDENCE)."
>> + (pcase sym
>> + ((or 'nonl 'not-newline 'any) (cons (list ".") t))
>
> Is there a reason not to use '((".") . t) here (and similar for the rest
> of the alternatives)? If yes, then it's probably worth mentioning in a
> comment.
It's because they may be fed into mapcan; I'll add a comment (or maybe use something non-destructive). Thank you.
> If not using string-to-multibyte, I think this lambda can be replaced
> with #'unibyte-char-to-multibyte.
Didn't know about that one, thank you!
next prev parent reply other threads:[~2019-09-05 16:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-02 21:19 New rx implementation with extension constructs Mattias Engdegård
2019-09-04 14:18 ` Mattias Engdegård
2019-09-04 17:03 ` Paul Eggert
2019-09-05 10:56 ` Aurélien Aptel
2019-09-05 11:17 ` Mattias Engdegård
2019-09-05 12:34 ` immerrr again
2019-09-05 19:04 ` Mattias Engdegård
2019-09-05 15:38 ` Noam Postavsky
2019-09-05 16:49 ` Mattias Engdegård [this message]
2019-09-06 14:09 ` Mattias Engdegård
2019-09-07 14:13 ` Noam Postavsky
[not found] ` <0E5A5E92-E48F-4003-A742-508663BA984A@acm.org>
2019-09-11 18:11 ` Mattias Engdegård
2019-09-17 12:53 ` Mattias Engdegård
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=0D601D4F-B6CF-44D1-A8C1-28A51EE850A2@acm.org \
--to=mattiase@acm.org \
--cc=emacs-devel@gnu.org \
--cc=npostavs@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 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).