Re: Implicit None for IDL??? [message #4646] |
Tue, 27 June 1995 00:00 |
afl
Messages: 51 Registered: December 1994
|
Member |
|
|
In article <3snheg$63a@senator-bedfellow.MIT.EDU>, davis@space.mit.edu (John E.
Davis) writes:
|> Hi,
|>
|> Is there anyway to get IDL 4.0 to signal and error if a variable is
|> undefined? I realize that IDL will generate a runtime error for this kind
|> of mistake:
|>
|> some_variable = 3
|> ; Now double its value
|> some_variable = 2 * some_vriable ; Oops spelling error!
|>
|> However, this mistake will not be caught by idl:
|>
|> some_variable = 3
|> ; Now double its value
|> some_vriable = 2 * some_variable
|>
|> If this is not possible, is there a lint for the language, e.g., something
|> to generate a message like:
|>
|> something.pro: line 27: `some_vriable' unused.
|>
|> Thanks,
|> --John
|>
|>
This question deserves serious consideration as "QUESTION OF THE YEAR!"
I use implicit none in all my FORTRAN development... it is the safest
way to create massive amounts of error-free code, but I have never
seen a way to implement this in IDL, and that is one reason I believe
IDL is not well suited for development of large applications. Another
problem is that variables can suddenly change type within IDL,
consider this simple example...
j = 1L & foo = 1.
i = 2*2 & help, i ; i is a Short integer
i = i*j & help, i ; i is a Long integer
i = i * foo & help, i ; i is Real
this feature is great for many situations, but again, in a large
application this may not be what is wanted by an uncareful programmer,
but it is a difficult thing to control within 10,000 lines of code. IDL
is a powerful language, but it does require one to be mighty careful.
The fix, long, float, complex, etc... functions must be used wisely!
I hope you receive an answer (rather than a reply like this one) to
your interesting question.
--
Andrew F. Loughe email: afl@cdc.noaa.gov
University of Colorado, CIRES voice: (303) 492-0707
Campus Box 449 fax: (303) 497-7013
Boulder, CO 80309-0449 USA
|
|
|