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

Re: Keyword precedence



Mark Hadfield (m.hadfield@niwa.cri.nz) writes:

> Now to control (say) the X axis the caller just sets xaxis_properties equal
> to a structure containing the appropriate keyword:value pairs, e.g.:
> 
> my_visualisation, XAXIS_PROPERTIES={notext:1, minor:0}
> 
> Now this approach obviously relies on the "_properties" structures
> overriding the defaults. 

This is how I've been configuring, for example, the PostScript
device for just about forever:

   ps_device_keywords = PSConfig()
   Set_Plot, 'PS'
   Device, _Extra=ps_device_keywords 

It works great in a nice, controlled environment like
PSConfig, where I know *exactly* what keywords are
going to be in the structure coming back from it.
If I want to make sure a value is set (Color is an
obvious one), I can always force it:

   ps_device_keywords = PSConfig()
   ps_device_keywords.color = 1
   Set_Plot, 'PS'
   Device, _Extra=ps_device_keywords 

But I have been much more wary of letting the user
create inherited structures, for some of the same
reasons you and JD so elegantly describe.

But I appreciate the discussion and the time everyone
has devoted to figuring this out. It has been extremely
helpful. Thank you.

Cheers,

David
-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155