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

Re: check for duplicate routine names?

"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


Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response