[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Raw strings (experimental patches inside)
From: |
Dmitri Paduchikh |
Subject: |
Re: Raw strings (experimental patches inside) |
Date: |
Sat, 11 Aug 2012 17:05:53 +0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Stefan Monnier:
>>> 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.
SM> Why not?
>> You still need to *double*-backslash-escape, backslash-escaping is
>> insufficient.
SM> If the special chars don't need to be backslash escaped, then you don't
SM> need to double escape either, obviously.
I like the Lua way of solving this problem. They use different
characters for string and regexp escaping (\ and % correspondingly).
Choosing the same character for both purposes really creates a huge
opportunity for confusion, IMO.
$ lua
Lua 5.2.1 Copyright (C) 1994-2012 Lua.org, PUC-Rio
> =string.find('-xyz-', '(%w+)')
2 4 xyz
>
But they also do not escape parentheses and have raw strings in the form
of `[[...]]`.
--
With best regards,
Dmitri Paduchikh
- Re: Raw strings (experimental patches inside), (continued)
- Re: Raw strings (experimental patches inside), Ivan Andrus, 2012/08/04
- Re: Raw strings (experimental patches inside), Vr Rm, 2012/08/09
- Re: Raw strings (experimental patches inside), Stephen J. Turnbull, 2012/08/10
- Re: Raw strings (experimental patches inside), Stefan Monnier, 2012/08/10
- Re: Raw strings (experimental patches inside), Stephen J. Turnbull, 2012/08/10
- Re: Raw strings (experimental patches inside), Stefan Monnier, 2012/08/10
- Re: Raw strings (experimental patches inside), Stephen J. Turnbull, 2012/08/11
- Re: Raw strings (experimental patches inside),
Dmitri Paduchikh <=
- Re: Raw strings (experimental patches inside), Stephen J. Turnbull, 2012/08/11
- Re: Raw strings (experimental patches inside), Vr Rm, 2012/08/10
- Re: Raw strings (experimental patches inside), Davis Herring, 2012/08/10
- Learning Emacs regexp (was: Re: Raw strings (experimental patches inside)), chad, 2012/08/10
- Re: Raw strings (experimental patches inside), Stephen J. Turnbull, 2012/08/11
Re: Raw strings (experimental patches inside), Dmitry Gutov, 2012/08/10