Re: check for duplicate routine names? [message #23246 is a reply to message #23242] |
Fri, 19 January 2001 10:54   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
"Liam E. Gumley" <Liam.Gumley@ssec.wisc.edu> writes:
> Craig Markwardt wrote:
>> 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?
>>
... deleted by Craig
>
> I believe a function takes precedence over an identically named array
> subscripted with parentheses, e.g.
>
> IDL> min = indgen(10)
> IDL> a = indgen(5)
> IDL> print, min(a)
> 0
>
> Using square brackets eliminates the ambiguity between the function name
> and the variable name:
...
Point taken. I was more trying to say, "because these things can
*potentially* be confusing, it would be nice to have a tool that
checks for them." My example of MIN/MAX was a little trivial; there
are possible clashes with, say, the Astronomy library which are not as
obvious.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|