From: Michal Suchanek Date: 2008-07-26T00:09:29+09:00 Subject: Re: weird backsplash behaviour inside single quotes On 25/07/2008, Todd Benson wrote: > On Fri, Jul 25, 2008 at 9:33 AM, Todd Benson wrote: > > The backslash is a tool to escape the single quote inside a quote, > > therefore it must escape itself as well. > > > I should be more clear. If you have a symbol that performs a function > withing a domain (the quote) and you want to have the symbol not > perform that function, but just be part of the domain, you have to use > that symbol (escape) on itself. > well, there's no function to perform, there's no quote. And if we do not distinguish between situation when there is a quote or not then backslashing any other letter should also produce the letter. But then we will lose the reason for which single quotes were introduced in the first place: writing less backslashes. Still this does not work well even now. There are less backslashes needed to write \\something\something inside single quotes but the added characters aren't balanced: something\something can be written as is but for the double backslash a quadruple backslash is required. That's a confusing inconsistency in my view: if I write 'a\b' and it results in the exact value that is inside the quotes it is unexpected and inconsistent that I need '\\\\a\b' to write string with three backslashes. Perhaps the only solution would be to forbid quoting inside single quotes completely. Admittedly if only a backslash followed by a single quote was special writing strings with a trailing backslash would not be possible with single quotes. Thanks Michal