opensubscriber
   Find in this group all groups
 
Unknown more information…

e : emacs-devel@gnu.org 11 August 2012 • 2:50AM -0400

Re: Raw strings (experimental patches inside)
by Stefan Monnier

REPLY TO AUTHOR
 
REPLY TO GROUP




>> And here we're back at regexps.  I already agreed that they're
>> convenient for regexps, but pointed out that a better solution would be
>> to fix the regexp syntax so it doesn't backslash-escape every
>> special character.
> Yeah, I know -- I pointed that out too.  That's still not a substitute
> for raw strings in code.

Why not?

> You still need to *double*-backslash-escape, backslash-escaping is
> insufficient.

If the special chars don't need to be backslash escaped, then you don't
need to double escape either, obviously.

> It's only "better" if you have rawstring phobia.

I don't have rawstring phobia.  I just think it's a workaround which
makes Elisp's syntax more complex without fixing the real problem.

>> That would help not just Elisp coders but Emacs users as well and
>> would make Elisp regexps even more readable than raw strings can
>> ever hope to make them.
> True, but both is better.

I still haven't heard of a good argument why you'd still need
raw-strings if the regexp syntax was made not to need backslashes for
most special chars.
Could it make the syntax slightly better?  Yes.  Would the difference
be significant?  I doubt it.


        Stefan


Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.