_STRICT_EXTRA keyword [message #29821] |
Fri, 22 March 2002 09:22  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mark Hadfield mentioned a "_STRICT_EXTRA" keyword that
is available in IDL 5.5 the other day. I have reason
to think this may be what I am looking for, but I can't
seem to find it in the ... uh ... IDL 5.5 documentation. :-(
Does anyone know where this is? I've tried paging through
the What's New in IDL 5.5 pdf file (including looking in
the Index), but apart from going through the damn thing
word by word I have no idea....
Thanks,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: _STRICT_EXTRA keyword [message #29886 is a reply to message #29821] |
Mon, 25 March 2002 06:23  |
btupper
Messages: 55 Registered: January 2002
|
Member |
|
|
On Fri, 22 Mar 2002 13:01:16 -0700, JD Smith <jdsmith@as.arizona.edu>
wrote:
> You may find this bit I wrote up interesting. Too much detail for a
> tutorial, but it gives you the basic ideas, and even touches on
> _STRICT_EXTRA (bother indeed). I may repurpose this as a tutorial if
> enough people bug me.
>
> http://groups.google.com/groups?selm=3BE2FCDF.6A63C4C9%40ast ro.cornell.edu
>
Thanks JD,
I hadn't look long enough for that discussion, and now I wish I had.
Is it a silly idea to wish for yet another *_extra keyword? Here's
what is rattling around in my head: _VAL_EXTRA. This keyword would
perform the same service as _EXTRA, but would make the reference vs.
value behavior clearer to folks like me (who have enough empty space
between the ears for things to rattle around in.)
My confusion about these keywords is quite similar to my confusion
when I was learning about Newton's first law of motion. It was a
useless excerise until someone pointed out that you have to pay
attention to 'on', 'by' and other such clues in "When one object
applies a force *on* another...." Such is the case here, for me,
when I think about the following snippets:
From you...
> So, bottom line rule of thumb: always use _EXTRA in your calls (or at
> least, never use _REF_EXTRA...)
and..
> The RSI developers discovered a trick, however:
> they could isolate the required change only to the routine definition,
> and allow all the calling routines (including existing code) to continue
> to use _EXTRA as-is. And some routines might just do both! Yes, you
> can pass on a by-reference inherited keyword set to a by-value
> inheriting routine: the conversion is automatic.
From David...
> Here is the rule of thumb I would use. On every
> GetProperty method, I would *define* a _Ref_Extra
> keyword. But on every *call* to a GetProperty method
> I would use an _Extra keyword to pass the extra
> structure.
From Ted...
> When keywords are stored and passed along in
> the _EXTRA structures created in function declarations, however, they are
> stored in fields by value and the reference information is lost. This is
> fine if you only want to USE the value, but not if you want to CHANGE the
> value stored in the argument. In order to change the value in some other
> function, _REF_EXTRA allows you to pass along the output keywords by
> reference.
Thanks again,
Ben
|
|
|
|
Re: _STRICT_EXTRA keyword [message #29905 is a reply to message #29821] |
Fri, 22 March 2002 18:22  |
A. D. & J.C. Cool
Messages: 16 Registered: February 2000
|
Junior Member |
|
|
David Fanning wrote:
>
> Malcolm Walters (Malcolm.Walters@jet.uk) writes:
>
>> A quick loop in my paper copy shows this to be on page 33/34 under 'New
>> Ability to Check for Keyword Inheritance Errors'
>
> Thank you.
>
> David
David,
A simple Find operation on that IDLv55 HTML Help file that's on your
site
would have found "strict_extra" in half a jiff... ;-)
Andrew
|
|
|
Re: _STRICT_EXTRA keyword [message #29910 is a reply to message #29821] |
Fri, 22 March 2002 12:01  |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
Ben Tupper wrote:
>
> On Fri, 22 Mar 2002 10:22:25 -0700, David Fanning <david@dfanning.com>
> wrote:
>> Mark Hadfield mentioned a "_STRICT_EXTRA" keyword that
>> is available in IDL 5.5 the other day. I have reason
>> to think this may be what I am looking for, but I can't
>> seem to find it in the ... uh ... IDL 5.5 documentation. :-(
>>
>
> Hi,
>
> While the topic of *_Extra has surfaced... a while back there was an
> informative discussion here about the subtlies of _EXTRA and
> _REF_EXTRA. Was there ever a 'tutorial' ala the Rebin/Refom tutorial
> pulled together? I get an awful lot out of those.
>
> I ask because this has been a slippery subject for me. Everytime I
> build an object that inherits another, I fiddle-faddle with the
> inherited keywords with my fingers crossed until these keywords are
> properly passed along.
>
> The last time I did this (with the xGrid_Data object) I got so
> knotted-up that in the end I decided to simply copy *every* keyword
> for the superclass (Grid_Data object) into the INIT of the subclass
> object. It cut the knot, but it kinda hangs out there like an
> untucked shirt (and I hope no one notices.)
>
> Now this _Strict_Extra keyword... well, as Pooh might say, "Oh,
> bother!"
>
Ben,
You may find this bit I wrote up interesting. Too much detail for a
tutorial, but it gives you the basic ideas, and even touches on
_STRICT_EXTRA (bother indeed). I may repurpose this as a tutorial if
enough people bug me.
http://groups.google.com/groups?selm=3BE2FCDF.6A63C4C9%40ast ro.cornell.edu
JD
|
|
|
Re: _STRICT_EXTRA keyword [message #29916 is a reply to message #29821] |
Fri, 22 March 2002 10:29  |
btupper
Messages: 55 Registered: January 2002
|
Member |
|
|
On Fri, 22 Mar 2002 10:22:25 -0700, David Fanning <david@dfanning.com>
wrote:
> Mark Hadfield mentioned a "_STRICT_EXTRA" keyword that
> is available in IDL 5.5 the other day. I have reason
> to think this may be what I am looking for, but I can't
> seem to find it in the ... uh ... IDL 5.5 documentation. :-(
>
Hi,
While the topic of *_Extra has surfaced... a while back there was an
informative discussion here about the subtlies of _EXTRA and
_REF_EXTRA. Was there ever a 'tutorial' ala the Rebin/Refom tutorial
pulled together? I get an awful lot out of those.
I ask because this has been a slippery subject for me. Everytime I
build an object that inherits another, I fiddle-faddle with the
inherited keywords with my fingers crossed until these keywords are
properly passed along.
The last time I did this (with the xGrid_Data object) I got so
knotted-up that in the end I decided to simply copy *every* keyword
for the superclass (Grid_Data object) into the INIT of the subclass
object. It cut the knot, but it kinda hangs out there like an
untucked shirt (and I hope no one notices.)
Now this _Strict_Extra keyword... well, as Pooh might say, "Oh,
bother!"
Ben
|
|
|
|
Re: _STRICT_EXTRA keyword [message #29920 is a reply to message #29821] |
Fri, 22 March 2002 09:28  |
Malcolm Walters
Messages: 8 Registered: October 2001
|
Junior Member |
|
|
A quick loop in my paper copy shows this to be on page 33/34 under 'New
Ability to Check for Keyword Inheritance Errors'
Malcolm Walters
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.1705163ee9742028989843@news.frii.com...
> Mark Hadfield mentioned a "_STRICT_EXTRA" keyword that
> is available in IDL 5.5 the other day. I have reason
> to think this may be what I am looking for, but I can't
> seem to find it in the ... uh ... IDL 5.5 documentation. :-(
>
> Does anyone know where this is? I've tried paging through
> the What's New in IDL 5.5 pdf file (including looking in
> the Index), but apart from going through the damn thing
> word by word I have no idea....
>
> Thanks,
>
> David
> --
> David W. Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438, E-mail: david@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|