Modular programming in IDL....trouble [message #2193] |
Thu, 02 June 1994 13:31 |
gotwols
Messages: 16 Registered: January 1991
|
Junior Member |
|
|
As a long time user of IDL (10 years) I have access to a large number of
routines that are used over and over again. Lately however something
disconcerting has started to happen. A program which was working yesterday
suddenly stops working. Usually this can be traced to the fact that a new
function has been added to the library that has the same name as an array
in one of the routines being called. In brief then, the problem is a clash
between function names and array names.
The C language has a very elegant solution to the name clash problem:
All arrays are indicated with square brackets, eg. a[i], whereas all functions
have round brackets, eg. work(arg). Short of rewriting IDL (and PV-WAVE), I can
think of no work around for this problem other than the trivial one of giving
all functions names that are guaranteed not to clash with the arrays, say by
prefixing the function name with an underscore or something. After a decade
of development this is not a very good solution since it would require massive
changes to the code in the JHU/APL library as well as still leaving the problem
unsolved for code imported from other users.
Does anyone have a suggestion on how to cope with this problem? If left
unsolved it severely limits the modularity and reusability of all IDL and
PV-WAVE code.
--
Bruce L. Gotwols
Johns Hopkins University, Applied Physics Lab., Laurel MD 20723
Internet: gotwols@tesla.jhuapl.edu (128.244.147.15)
SPAN: APLSP::STR::GOTWOLS
|
|
|