> Well ... it's also possible to have a consistent, totally O-O parser > that handles this case without any problem. It just requires another > string representation. For example, in Python, there's an alternative > string representation that looks like this: > > r'a string with a single \ in it' > > The fact that it begins with "r'" tells Python's parser that > everything until the final single quote character is to be taken > literally, and therefore, backslashes don't need to be escaped. The > only exception is when you want a single-quote in the string, in > which case you need to double it, as so: > > r'a string with a single '' in it' > > The main place I see this usage in Python is in strings that are used > as arguments to the regular-expression parser, which is exactly what > we're talking about here. And since the one character that we'd have > to double (single-quote) is not a regular-expression meta-character, > we don't get any quadrupling of characters. > > I'm not trying to make any Ruby-Python comparisons here. I only am > bringing this up to give a widely used, real-world example of a > rigidly O-O method of parsing strings that doesn't complicate the > parsing of regular expressions. Actually, I went looking at the %Q(...) syntax before I sent that e-mail, since I was hoping Matz would have thought of that. Seems he didn't. I'm half-tempted to submit an RCR for this if nobody else has. It is a very useful feature, and as you pointed out, not entirely difficult (at least, I wouldn't imagine it is) to implement.