Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: bug in bs4rw (or bug in Stata?)
From
Keith Dear <[email protected]>
To
[email protected]
Subject
Re: st: bug in bs4rw (or bug in Stata?)
Date
Thu, 24 Mar 2011 10:31:52 +1100
Yes it's a fine point. Isn't programming mostly about fine points?
The error message "options not allowed" is potentially misleading --
it misled me!
I read it as saying "you are wrong to provide options here" -- seems
natural enough? But that is NOT quite what it means.
The message led me to dig around inside bs4rw to see why it was
calling our program with options.
I found the call, which was essentially
`cmdname' `cmdargs' `wgt' if `touse', `cmdopts' `rest'
It took me a while to determine that `cmdopts' and `rest' are indeed
empty as they should be, and the problem is the comma itself.
The problem is that bs4rw is assuming that our program has options
(whether invoked or not), which it doesn't ("syntax [pweight /]
[if]").
Stata is really saying "you are wrong to think that this command has
any options". Subtly different.
"comma not allowed" would have saved me some time.
Keith
On 24 March 2011 09:12, Nick Cox <[email protected]> wrote:
> It's a fine point.
>
> Stata is doing its best to diagnose the problem. If it was more
> conservative, it would simply say "syntax error" and people would want
> more detail. As it is, it tries to provide more detail, and it doesn't
> always diagnose right.
>
> In any case, what other interpretations would an isolated comma bear
> -- given your -syntax- statement?
>
> Nick
>
> On Wed, Mar 23, 2011 at 9:43 PM, Keith Dear <[email protected]> wrote:
>
>> Nick: you say "-syntax- is not talking semantics, it is talking
>> syntax", but it seems to me that although -syntax- may be *thinking*
>> syntax, when it says "options not allowed" it is *talking* semantics,
>> i.e. trying to be smart. It should say "comma not allowed" since that
>> is the syntax error. But I accept this doesn't amount to a bug in
>> Stata, and anyway the problem is really with bs4rw.
>>
> *
> * 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/
>
--
Dr Keith Dear
National Centre for Epidemiology and Population Health
ANU College of Medicine, Biology and Environment
Australian National University
Canberra, ACT 0200 Australia
CRICOS provider #00120C
Phone +61 (02) 6273 2208
Mobile 0424 450 396
*
* 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/