From: Alan Mackenzie <acm@muc.de>
To: Phil Sainty <psainty@orcon.net.nz>
Cc: "Mattias Engdegård" <mattiase@acm.org>,
"Stefan Monnier" <monnier@iro.umontreal.ca>,
emacs-devel@gnu.org
Subject: Re: regular expressions that match nothing
Date: Fri, 17 May 2019 09:43:01 +0000 [thread overview]
Message-ID: <20190517094301.GA5011@ACM> (raw)
In-Reply-To: <39a146e4709b532db817abc47f17799b@webmail.orcon.net.nz>
Hello, Phil.
On Fri, May 17, 2019 at 11:18:49 +1200, Phil Sainty wrote:
> > 15 maj 2019 kl. 21.41 skrev Alan Mackenzie <acm@muc.de>:
> >> I think regexp-unmatchable is too much of a mouthful.
> I like it, myself. I think the meaning is 100% clear and unambiguous
> for the reader (which I can't say about the alternative suggestions
> that I've seen).
I find it too difficult to read. My brain simply doesn't recognise it
instantly, the way it would re-nomatch. At the moment, given there is
no similar symbol name in Emacs, this is less urgent, but if more
similar long symbols were introduced this would be a pain - a minor pain
yes, but a pain nevertheless.
> Are we expecting this to be used so much that we're prioritising
> brevity over clarity?
Brevity is clarity - up to a point. We write `defun', not
`define-function'. Who would argue that the latter of these is clearer?
Why has nobody commented on my suggestion of using re- rather than
regexp- as the prefix? We already have re-search-forward.
> (That's a genuine question -- I have a similar definition in my own
> config, and I have exactly one use for it.)
There are quite a few uses of "a\\`" in CC Mode. If they were to be
replaced by regexp-unmatchable, I might have to re-flow the code, to
avoid it going too far over 80 columns.
> On 2019-05-16 22:54, Mattias Engdegård wrote:
> > 4. The point of this name isn't to be shorter than the regexp string
> > it represents, but to be more readable and avoid mistakes and
> > substandard reinventions.
> Quite.
> > 2. (rx (or)) is even shorter than re-nomatch, and is very memorable.
> > (rx (|)) is shorter still.
This is undesirable in source files which don't otherwise use rx. It's
also cryptic, forcing some readers to do research.
> I don't think those are much better than people using "a\\`".
> *Surely* `rx` can simply acquire a symbol for this?
> (rx unmatchable) or similar?
> -Phil
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2019-05-17 9:43 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-14 7:25 regular expressions that match nothing philippe schnoebelen
2019-05-14 10:14 ` Mattias Engdegård
2019-05-14 19:41 ` Stefan Monnier
2019-05-15 16:21 ` Mattias Engdegård
2019-05-15 19:41 ` Alan Mackenzie
2019-05-16 10:54 ` Mattias Engdegård
2019-05-16 23:18 ` Phil Sainty
2019-05-17 9:43 ` Alan Mackenzie [this message]
2019-05-17 10:17 ` Mattias Engdegård
2019-05-17 12:53 ` Stefan Monnier
2019-05-15 20:17 ` Michael Heerdegen
2019-05-15 21:06 ` Stefan Monnier
2019-05-15 21:07 ` Mattias Engdegård
2019-05-15 21:38 ` Michael Heerdegen
2019-05-16 6:57 ` More re odditie [Was: regular expressions that match nothing] phs
2019-05-16 9:29 ` Mattias Engdegård
2019-05-16 10:59 ` phs
2019-05-16 12:31 ` Stefan Monnier
2019-05-16 18:35 ` Michael Heerdegen
2019-05-16 20:31 ` Mattias Engdegård
2019-05-16 21:01 ` Global and local definitions of non-functions/variable (was: More re odditie [Was: regular expressions that match nothing]) Stefan Monnier
2019-05-20 16:26 ` Bootstrap/autoload policy (was Re: regular expressions that match nothing) Mattias Engdegård
2019-05-22 14:02 ` Stefan Monnier
2019-05-22 14:07 ` Mattias Engdegård
2019-05-22 14:24 ` Stefan Monnier
2019-05-22 15:06 ` Mattias Engdegård
2019-05-22 15:53 ` Stefan Monnier
2019-05-22 16:40 ` Mattias Engdegård
2019-05-22 19:08 ` Stefan Monnier
2019-05-26 12:05 ` Basil L. Contovounesios
2019-05-16 18:12 ` regular expressions that match nothing Eric Abrahamsen
2019-05-19 4:30 ` 回复: " net june
2019-05-19 5:00 ` HaiJun Zhang
2019-05-19 7:32 ` Mattias Engdegård
2019-05-20 7:56 ` philippe schnoebelen
2019-05-20 23:19 ` Richard Stallman
2019-05-19 14:12 ` 回复: " Drew Adams
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=20190517094301.GA5011@ACM \
--to=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=mattiase@acm.org \
--cc=monnier@iro.umontreal.ca \
--cc=psainty@orcon.net.nz \
/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.