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

Re: IDL 5.3 serious problem: save files sneakily restored



"Martin Schultz" <martin.schultz@dkrz.de> wrote in message
39A639C7.3D01A75C@dkrz.de">news:39A639C7.3D01A75C@dkrz.de...
> When a file is specified by typing only the filename at the IDL
> prompt, IDL searches the current directory for filename.pro
> (where filename is the file specified) and then for filename.sav.
> If no file is found in the current directory, IDL searches in the
> same way in each directory specified by !PATH. If a file is
> found, IDL automatically compiles the contents and executes any
> functions or procedures that have the same name as the file
> specified (excluding the suffix).
>
> So, at least theoretically, pro should get executed before sav.
> And this makes all the sense in the world, because otherwise it
> would be hard for authors of compiled files to develop them -
> they would have to delete the sav file each time they modify the
> pro file and want to test changes.

In Python (which is many ways similar to IDL) the corresponding extensions
are .py (source code) and .pyc (compiled). When a .py file is compiled, a
.pyc file is created in the same directory. Thereafter Python loads the .pyc
unless the .py has a more recent modification date. This is one of those
ideas that is so clever it seems obvious once someone else has thought of
it. Why can't IDL do that?

---
Mark Hadfield
m.hadfield@niwa.cri.nz  http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand