[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ELisp: special read syntax for regular expressions?
From: |
David Hansen |
Subject: |
Re: ELisp: special read syntax for regular expressions? |
Date: |
Tue, 15 Apr 2008 06:24:02 +0200 |
User-agent: |
Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux) |
On Mon, 14 Apr 2008 23:27:53 +0000 (UTC) Ilya Zakharevich wrote:
> [A complimentary Cc of this posting was sent to
> David Hansen
> <david.hansen@gmx.net>], who wrote in article
> <mailman.10052.1207428807.18990.help-gnu-emacs@gnu.org>:
>> > I think I know the answer: one needs to allow a special read syntax
>> > for regular expressions (the result being an ordinary string). This
>> > way one can avoid the acute backslashitis [by inverting \( and (,
>> > etc], the regular expressions may be specially indented, and the
>> > syntax highlighter would have a chance to remove most of the remaining
>> > complexity by proper highlighting (similar to CPerl one).
>> >
>> > What do you think?
>>
>> Have a look at the Gauche Scheme implementation. It has a regexp read
>> syntax: #/.../.
>
> IMO, having SLASH hardwired as a delimiter is a silly choice; it makes
> matching a slash harder, UNNECESSARILY. If one MUST hardwire some
> delimiters, it should better be () (since un-backwacked parens are
> almost guarantied to be matched inside a regular expression, one needs
> no extra backwacking to enclose the REx into MATCHED parens).
>
> Any thoughts? Is /(REX) prohibited by some considerations?
The lisper will expect a `#' to see that it it's a special read syntax,
and it's probably a good idea to stick with CL conventions/standards[1].
I'd vote for #/<any paren>REX<matching closing>. But I have to admit
that I don't know anything about the emacs lisp reader. Maybe the
discussion should be moved to emacs-devel.
David
Footnotes:
[1] http://www.lispworks.com/documentation/HyperSpec/Body/02_dh.htm
- Re: ELisp: special read syntax for regular expressions?, (continued)
Re: ELisp: special read syntax for regular expressions?, Mike Mattie, 2008/04/09
Message not available