Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Left quoting


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Left quoting
Date   Fri, 5 Dec 2003 12:01:14 -0000

No. That is how the Stata language is, 
and there is at least one very good reason for it. 

Stata allows references to nested macros, and 
they are extremely useful. If you look at most 
substantial programs, you will see stuff like 
``i'' and `a`i''. (Wrapping your head around 
this is a crucial step in learning Stata programming, 
but worth the effort.) 

Given that fact, there would be a problem 
if there no distinction between the start 
of a local macro reference and the end of 
one, as expressions like 

'a'i'j' 

would be ambiguous: is this 

1. the local macro 'a'
   followed by the character "i"
   followed by the local macro 'j' 

or 

2. the local macro 'i'
   nested within another local 
   macro whose name starts 
   with "a" and whose name 
   ends with "j"

? 

The interpretation could be very 
different. `a'i`j' and `a`i'j' 
remove the ambiguity. 

In addition, the stylistic affront 
is dependent on what font you use. 
I happen to be writing this font 
in a font in which the left quote 
slopes and the right font is vertical
-- and, dependent on your set-up,
you reading this may see something 
similar -- and I agree that is ugly. 
The remedy is to change the font, 
and in particular Stata's own fonts 
preserve the leftness of left quotes
and the rightness of right quotes, 
so all gaucheness or sinister behaviour 
is matched by its mirror image. 

Nick 
n.j.cox@durham.ac.uk 

Clive Nicholas
 
> Could you use (') instead of (`)? It looks nicer stylistically.
 
> Nick Cox wrote:
> 
> [...]
> 
> > `=   that is left quote followed by =
> >
> > means "evaluate what follows between here and the matching right
> > quote".

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index