[Top][All Lists]

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

Re: Raw strings (experimental patches inside)

From: Dmitry Gutov
Subject: Re: Raw strings (experimental patches inside)
Date: Sat, 11 Aug 2012 21:05:03 +0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0

On 11.08.2012 11:49, Stephen J. Turnbull wrote:
  > This would be a backward-incompatible change to the regexp engine,
  > wouldn't it?

Not to the matching engine, but to the regexp compiler.

It would be reasonable easy to implement backward-compatibly:  if a
string's first character has a non-nil "punc-are-operators" property,
then all punctuation would be interpreted as regex operators *unless*
they are escaped.

At which point would the string obtain this text property? If we're discussing the case of using it in Elisp source code, this would need to be done in the reader, no? Which brings us back to "special syntax".

To be clear, I'm in favor of special syntax for regexps (raw strings or otherwise), and I was trying to argue that adding special syntax might be easier than work around the backward compatibility problem.

Neither the property name nor the API are likely to be optimal, but it
would work.  You could also do it with some kind of variable.

I suppose it would work if the new variable is used similarly to `lexical-binding'.

reply via email to

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