[Doc-SIG] quoting

Tony J Ibbs (Tibs) tony@lsl.co.uk
Wed, 14 Mar 2001 10:36:07 -0000


Edward D. Loper asked:
> Could someone point me to an explanation of why we *don't* want to use
> backslashes for backslashing characters? :)  e.g., \* for a literal
> asterisk.  It seems so much like the natural thing to do, and surely
> someone who's coding in python will be familiar with the convention
> of backslashing characters..

I'll have a quick try, although it is actually the intersection of
several reasons.

First, practical. In a docstring, you can't just type '\', you'll have
to type at least '\\', and maybe even more. This is a pain.

Secondly, in ST *text* (and all of the ST family are intended for
writing plain text as well, including STpy), it doesn't read well - it's
not something one would naturally type, unlike '...' which *is*, well,
quoting.

Thirdly, I actually have a gut feeling that using the same escape
character for ST text as one uses for strings is going to be awkward
anwyay (it *does* tend to lead to the "four backslashes means one"
phenomenon, and it's just rather awkward to handle mentally).

Fourthly, I think it is instructive to note that there has never been
much demand in the STClassic world to solve this, and even STNG isn't
worrying about it too hard - that means that most people, most of the
time, have managed either not to care or to work around the problem.

And fifthly, note that there *is* only one truly awkward case, which is
how to quote a single quote. In STpy one can force use of #'# (gosh, I
need to add that to my test cases, but it *should* work), or give up and
use "'", or just talk around the issue.

(a literal asterisk is, of course, just '*')

Tibs

--
Tony J Ibbs (Tibs)      http://www.tibsnjoan.co.uk/
"How fleeting are all human passions compared with the massive
continuity of ducks." - Dorothy L. Sayers, "Gaudy Night"
My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.)