Bookmark and Share

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: Re: Listing user-written ado files called by program


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Re: Listing user-written ado files called by program
Date   Thu, 8 Sep 2011 08:45:47 +0100

On Thu, Sep 8, 2011 at 5:06 AM, Partho Sarkar <[email protected]> wrote:
>
> Thanks to Stas Kolenikov for his succinct and useful suggestions, especially:
>
> “At the very worst, you can always protect your non-official commands
> in place with
>
> capture listtab
> if _rc == 199 ssc install listtab, replace
> listtab <blah>  “

Just to point out the obvious: this assumes installation from SSC and
won't work in respect of user-written programs from elsewhere.

> Richard Williams expressed some misgivings about building programs
> which depend on user-written ado files that may or may not be updated.
>  This highlights another aspect of the problem.  Thanks in particular
> for this suggestion:
>
> “Depending on what you are doing, you might consider incorporating
> snippets of code from other programs and include acknowledgements in
> the comments”.
>
> I had thought of this, but wondered if this would be quite ethical/proper.

This occurred to me too after my first posting. People have done this
in the past.

I think most user-programmers are happy to see their work used so long
as it is acknowledged fully and fairly. There is one obvious rule: you
can always try to check with the author concerned.

> 1.      “…The ideal situation would be to have a way to track these
> dependencies (including specific versions) programmatically.  … the
> install command (e.g., -net install- or -ssc install-) should comply
> by installing those dependencies automatically, or at least issuing a
> warning if they are not already installed.

-ssc- is just a wrapper for -net-. I am not sure about this. It's a
nice ideal, but it is not clear to me how it would work in practice.
It would depend on a good way to detect automatically what is
required, which is precisely where we started. I think it's reasonable
to expect authors to document in the help what is used and users to
read the help. As a contributor to SSC and a user of others' programs,
that's my expectation.

> 2.      Similarly, it would be nice if there were something like a
> "require" command that you could use in a do-file to check for a set
> of dependencies (including specific versions).  Certainly, this type
> of dependency handling is more important in environments where people
> are frequently writing programs that plug into or extend other
> programs, or where they are making a lot of use of shared libraries.
> There's no reason you couldn't do this in Stata/Mata [though] one
> could perhaps make an argument that …the added complexity isn't worth
> it.

I agree to the last point.

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index