comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Keyword precedence
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Keyword precedence [message #21439 is a reply to message #21389] Mon, 28 August 2000 00:00 Go to previous messageGo to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Mark Hadfield and John-Cavid Smith had a long discussion in which
Mark wrote at some point:


>
> I think the rule should be, where a choice has to be made between duplicate
> keywords, always choose the last one in the list.
>

now for the slow-movers: does this mean that
wrapper, color=12, _Extra=e
and
wrapper, _Extra=e, color=12

should yield different results if there is a color tag in the
extra structure? I could see some benefits to this, but it would
alter the whole idea of keywords being position independent as
opposed to parameter arguments.

Although this may seem overly formal, I would argue that the
"convenience" gained by overriding keywords that are explicitely
set with values in the extra structure does not aid in writing
"clean" programs. If you are messing with any particular property
in your routines, this property should always be identified by
having its own keyword in my opinion. So, if you want a default
color, the procedure header should be something like:

pro wrapper, color=color, _EXTRA=e

IF N_Elements(color) EQ 0 THEN color = 12
plot, x,y, color=color, _EXTRA=e

end

and the "real" color keyword should be used (which I think and
hope it gets).

Conclusions (these tend to come near the end of an article ;-):

I agree with JD that IDL should be stricter and issue an error if
it finds more than 1 keyword of the same name in a _ref_extra
list, and perhaps it should even be possible to generate an error
if the two identical keywords appear in the _extra list (another
compile_opt flag?).

Cheers,
Martin




--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie
[[
[[ Bundesstr. 55, 20146 Hamburg
[[
[[ phone: +49 40 41173-308
[[
[[ fax: +49 40 41173-298
[[
[[ martin.schultz@dkrz.de
[[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: From PV-WAVE to IDL
Next Topic: Re: Gridding options

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 00:55:33 PDT 2025

Total time taken to generate the page: 0.88542 seconds