[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Many procedures, what to do?
Craig Markwardt wrote:
>
> davidf@dfanning.com (David Fanning) writes:
> > I have to admit, I'm always confused when I read articles
> > like this. I've been writing IDL programs for over 12 years
> > now, and I've maybe used FORWARD_FUNCTION three times. I
> > have gotten the wrong FOO program from some other directory
> > maybe a few times more than that. But I have never, in all
> > those years, had difficulty getting programs to compile
> > and run when they are suppose to.
>
> Hi David--
>
> I guess what I'm saying is that I *already* have a library of 25
> individual files that do low-level stuff. I am feeling like this is a
> pain in the butt for me and for other people to manage. Also, all of
> these functions share a lot of common parameters and keywords, so it
> makes sense to only document them once, rather than in each file. All
> typing and no rest makes Craig a bad carpal tunnel boy.
Hmm. I have encountered a (far less numerous) problem like this that involved 4 functions. The top
level _REF_EXTRA dribbled all the way down to the lowest level, but each routine had, at some point,
been used as an entry point. At first I didn't want to document every single doc header with the
_REF_EXTRA keywords for the lowest level function, but then I considered the poor unfortunate user
that would have to doc_library, '' again and again to find out what the extra keywords actually
were. I bit the bullet and replicated the lowest level keyword documentation in all of them.
For your case with many more components, a utility to do this automatically would be the ticket. I
have done similar things with shell scripts using sed and awk. A pain I grant you, but once done,
it's done.
> My thought was to collapse all these routines into one single file.
> That way it's easy to keep everything in one place, and there can be
> lots of shared documentation.
>
> The problem with that is then there are a bunch of functions like
> CMSV_RLONG CMSV_RSTRING, CMSV_RCOMM, stored in a file called
> cmsvlib.pro. IDL has no way to figure out these functions are stored
> in cmsvlib.pro, or for that matter that they are functions at all.
>
> You are saying, "put each function in a separate file." I am saying,
> "I already have that, but am wondering whether one single library file
> would be more convenient for downloaders."
For downloading, why not use a tarball/zipfile? Personally, I dislike a whole bunch of routines
smooshed into one IDL file as you have suggested - IDL isn't geared to handle this sort of thing (as
you've pointed out).
Anyway....
paulv
--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301) 763-8000 x7274 There shallow draughts intoxicate the brain,
Fax: (301) 763-8545 And drinking largely sobers us again.
Email: pvandelst@ncep.noaa.gov Alexander Pope.