Re: IDL 8.0 compile_opt changes [message #69184 is a reply to message #69183] |
Fri, 18 December 2009 18:26   |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Dec 18, 4:51 pm, Chris Torrence <gorth...@gmail.com> wrote:
>
> 1. Change the default to be "compile_opt idl2", add a new "compile_opt
> idl1" to restore the existing behavior, and require users to retrofit
> existing code.
>
I strongly support this option.
ITTVIS (then RSI) introduced square brackets with V5.0 in 1997. At
the time, I wrote a procedure
http://idlastro.gsfc.nasa.gov/ftp/contrib/landsman/v5/idlv4_ to_v5.pro
to automatically convert procedures using round parentheses for
indexing to use square brackets instead. idlv4_toV5 isn't perfect
-- it can get confused by parentheses within strings or matching
parentheses not on the same line -- but it took care of 95% of the
work, and I was able to convert the entire Astrolib.
From that time, whenever I've modified an astrolib procedure, I also
added a compile_opt idl2 at the beginning. The idea was that while I
was a testing a procedure for a new modification, I could also test if
making the default integer type long introduced any problems. And
there was one case where making the change did introduce some subtle
problems. This was for some homemade low-level database software
in which one parsed a byte stream. What happened was that "a = 0 &
readu,1,a" was now reading 4 bytes instead of 2. But this was the
only case of a problem, and I haven't had another problem in the past
eight years. I would think that 12 years of recommending compile_opt
idl2 is enough for people to adjust.
I should also add as an old (in more than one sense of the word)
programmer, I was never really comfortable with IDL objects until I
started learning some Python. Seeing the dot notation made me
realize that an object is just an IDL structure with functions
included ;-) So I agree that adding the dot notation to IDL should
certainly help new users. --Wayne
|
|
|