emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Raw" string literals for elisp


From: Alan Mackenzie
Subject: Re: "Raw" string literals for elisp
Date: Wed, 8 Sep 2021 19:36:31 +0000

Hello, Philip.

On Wed, Sep 08, 2021 at 19:22:18 +0000, Philip Kaludercic wrote:
> Alan Mackenzie <acm@muc.de> writes:

> > It is more readable in the same way Cobol was very readable; each small
> > grouping of text is immediately understandable.  But the thing as a
> > whole?  The rx form of that regexp takes up 6 lines, the string form 1
> > line.  If there are several regexps in a function rx can lead to a lot of
> > bloat.  Having the function fit entirely on one's screen contributes a
> > lot towards readability and maintainability.

> The reason I use rx in a lot of my scripts is that I can add comments,
> explanations, formatting, etc. when it gets complicated. I think that is
> a significant advantage, that even raw strings wouldn't have (unless a
> comment syntax were to be added into the regular expression language,
> which is unlikely).

Yes, I can see that.  rx certainly has advantages.  But it has
disadvantages too, which Mattias appears not to want to admit exist.  To
be honest, I suspect the differences in readability/maintainability
between the two forms will be small.  Maintaining Emacs, it is most
helpful to have at least a reading competence with both forms.

> -- 
>       Philip Kaludercic

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]