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

Re: check for duplicate routine names?



Michael W Asten (masten@mail.earth.monash.edu.au) writes:
 
> It is a stupid error to have a two routines of the same name
> DoitNow.pro , in two different library files MyLib1.pro and MyLib2.pro
> .
> But your correspondent is sometimes stupid.  The consequence of course
> is that the second compilation (of MyLib2.pro ) over-rides the first (of
> MyLib1.pro) , so  whatever was intended by maintenance of the code in
> MyLib1.pro does not execute.  Or worse, when the two libs are compiled
> in different sequences, results become unpredictable.
> 
> IDL does not appear to give any warning of the compilation of a routine
> of same name as one already compiled.  Has anyone any ideas on how such
> errors can be trapped ?
> 
> I suggest that at least in an IDL Project, the command "Compile all
> routines"  should include such checking as a debugging tool.  Or am I
> merely shifting blame for my stupidity onto the compiler?  (you know how
> it is when you bang your head the second time, on the same kitchen
> cupboard door?).

What you need is a language with a little more
structure to it. Why not give up IDL and try
Pascal. :-)

Cheers,

David

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