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

Home » Public Forums » archive » Re: check for duplicate routine names?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: check for duplicate routine names? [message #23256 is a reply to message #23255] Fri, 19 January 2001 08:34 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
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.


Yes, I think IDL would be improved by more quality-of-code features
that could detect problems like this.

Another thing that would be nice is warnings about ambiguous uses of
variables that might shadow a function in the library. Note this
code:

max = max(x, min=min)

The next time you use min(x), will you get the function or the
variable named min?

You might say, "oh, I used square brackets, this is not a problem,"
but since round parenthesis are still allowed (unless you disable
them), I believe this can still be a problem. This has bitten me a
*few* times, so I'm not saying it's a huge deal. It is a compile time
issue since peoples' function libraries are different.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL and basic stable! widgets [Example program??]
Next Topic: Re: Printf and line breaks

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

Current Time: Sat Oct 11 15:09:20 PDT 2025

Total time taken to generate the page: 1.12274 seconds