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

undefined keyword variables


A question: should you always be able to pass undefined variables as
keywords to IDL routines?

For example, PLOT is smart enough not to do anything with this undefined

IDL> plot,x,y,title=donkeykong
[plots fine]

but not this one
IDL> plot,x,y,clip=pong
% PLOT: Variable is undefined: PONG.
% Execution halted at:  $MAIN$                 
[no plot produced]

IDL> help,donkeykong, pong
PONG            UNDEFINED = <Undefined>

Should this be considered a bug in plot, or as normal behavior?

In general I don't know why you should be able to safely feed
undefined variables to routines and expect them to work.  But if you
can't, it leads to annoying problems in writing interfaces to any
routine with lots of keywords.  In my case, I wanted to write a
routine that called plot and then oplot, which use different sets of
optional keyword parameters.  The best solution I know of is to
construct a value for the _extra keyword, but it's a pretty convoluted

Mark Fardal