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

Re: Cant find functions in lib



"Kenneth P. Bowman" wrote:
> 
> In article <MPG.1536350bbbff2315989dce@news.frii.com>, David Fanning
> <davidf@dfanning.com> wrote:
> 
> > Yes, it has to be LAST, but really only if you want it
> > to work all of the time. :-)
> 
> I have never understood the reason(s) for this, and find it somewhat
> inconvenient.  If I have (say) a procedure and a few related functions
> that I would logically keep in the same file, it also seems logical to
> me to put the "main" procedure (the one whose name matches the
> filename) at the beginning of the file, rather than burying it at then
> end.  Why doesn't IDL simply compile everything in a file?  What value
> does the user get from stopping the compilation part of the way through
> a file?  (Aside from confusing newbies, of course, which has, at least,
> mild entertainment value.)

The answer, if you can call it that, is that that is the way it's done. At some point
someone had to make a decision about how to do this (probably the illustrious DS sitting
in front of a PDP-11/70 terminal....). However, I don't see any problem with this method.
It's a relatively simple way to, uh, encourage programmers to group what could be
considered as "PRIVATE" functions/procedures with the "PUBLIC" namesake
function/procedure, i.e. the last one. If there was to be a change to the way this worked
I would prefer that, while IDL would still compile everything in the file, *ONLY* the
namesake routine be available to the outside world. If you require the preceding routines
outside the namesake procedure, stick it in its own file. Not very sophisticated I'll
grant you (without introducing all manner of IDL "directives" indicating which routine is
private or public?).

I don't know how this would be done, or even if it can. If it was, I'm sure it would break
about 99% of IDL code out there.

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.
paul.vandelst@noaa.gov                   Alexander Pope.