comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Cant find functions in lib
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Cant find functions in lib [message #24551] Thu, 05 April 2001 02:01 Go to next message
Dominik[1] is currently offline  Dominik[1]
Messages: 46
Registered: April 2001
Member
Helle there,

I am using IDL for imaging in Nuklear Medicine. We wrote a big library
(NukMed.pro) with some functions and dont wont to compile it each time. So
we thought to put it in the lib directory of IDL, where IDL itself puts all
its *.pro.
But when we try to use it, IDL doesnt find the functions we used the whole
time. Do I have to precompile it or to sign up in a special list for all
*.pro files?

Thanks
Dominik
Re: Cant find functions in lib [message #24595 is a reply to message #24551] Fri, 06 April 2001 06:45 Go to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
"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.
Re: Cant find functions in lib [message #24598 is a reply to message #24551] Thu, 05 April 2001 17:35 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Kenneth P. Bowman (kbowman@null.net) writes:

> 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.)

You know, I don't ask why RSI does some of the things
it does. But the last words I say before I go to
bed every night are "Please, Lord, don't let those
bullies from Kodak change the way RSI does things!".

Cheers,

David

P.S. Let's just say that for those of you who have
been around the block a few times and know what you
are doing, there is also Resolve_Routine, /Compile_Full_File.
But I'd still put that main routine last. :-)

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: why is using objects so much slower ?
Next Topic: Re: spherical gridding problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:37:49 PDT 2025

Total time taken to generate the page: 0.00466 seconds