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

RE: st: question about gettoken and file


From   David Kantor <[email protected]>
To   [email protected]
Subject   RE: st: question about gettoken and file
Date   Wed, 26 Mar 2003 09:14:26 -0500

Nick's reply to Edwin Leuven:
At 01:36 PM 3/26/2003 +0000, you wrote:
Edwin Leuven
>
> but with the hidden stuff in stata perhaps there was a
> construct like
>
> program define myado, nosubst
>
> which then skips the substitution (perhaps a useful feature
> request?)

This may sound like a good idea, but I don't think
it will fly at all. There are at least two fundamental
issues arising:

1. It would mean that the user of an ado would
need to know (a) that an ado had this flavour and
(b) that in consequence such an ado could not be invoked using
local macros as they would not be substituted. Those
are big burdens to place on the user, whether
beginner or experienced. (a) bites the beginner hard
and (b) bites the experienced hard. Either way, this
violates the principle that a user should not
need to worry about the internal details of an
ado, so long as it does what it claims.

2. It would mean that to parse command lines
properly Stata would have to peek inside the
command being called to see how that command wants to
treat its input. Without exaggeration, this would
violate the whole way Stata is constructed
in terms of division of responsibilities.
[...]
It seems to me that what you want is for the calling environment -- not the called ado -- to dictate whether to prevent substitution. (It there already something like that?) Suppose there were a -nosubst- command prefix. Then you would call myado thus:

nosubst myado [...other elements and options...]

And there would be nothing special about how myado was written.

*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index