Statalist


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

Re: st: "smart programmers do use them..."


From   David Elliott <[email protected]>
To   [email protected]
Subject   Re: st: "smart programmers do use them..."
Date   Sat, 31 Jan 2009 11:25:45 -0400

Sergiy

Just wanted you to know someone made it to the bottom.

You have explored the heart of an issue that has tripped up many a
Stata programmer and, in my case, I've been bitten too many times to
count.  Working with, for want of a better expression, "safe"
situations (numerical variables, cleaned strings) one might never hit
situations like you have posed above.  However, sometimes we input
strings from other data sources or through -file read- situations and
may snag an errant {`} or {"} only to find out later that Stata has
ingested a hairball.  When compound double quotes don't work,
sometimes  -macval(mymacro)- can save you but I don't believe there is
a bombproof method to handle all cases.

I am hoping that other folks will jump in here with examples of
situations where people have had troubles and solutions they may have
employed.  I realize this slightly veers your original intent which
was to discuss how Stata parses lines, macro expressions, and the
error-messages (or lack thereof) associated with each of your special
cases.

For my own part, I would be very interested in the manner in which
programs are parsed.  Somewhere in that process, for example, is the
reason why non-Mata program code is interpreted and not compiled - but
that is best left to another thread.

Steelers!

--
David Elliott

Everything is theoretically impossible, until it is done.
Progress is made by lazy men looking for easier ways to do things.
-- Robert A. Heinlein (American science-fiction Writer, 1907-1988)
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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