Re: simple question (I hope) [message #53275 is a reply to message #53272] |
Fri, 30 March 2007 12:20   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
JD Smith writes:
> The one difference which makes this distinction more than pedantic is
> that true pass by value is very inefficient for large arrays. In a
> pass-by-value scheme, all of that data (801x1000x100) would be copied
> via the stack into the local address space of the routine MYPRO. It may
> sound like a subtle difference, but it does represent a real gain in
> efficiency, in particular when the temporary variable has a life outside
> the called routine. Eventually, all temporary variables are harvested,
> and their memory freed. So while you can't ever get at them yourself,
> they do offer advantages.
This is the kind of information I usually try to avoid,
since it makes it VERY hard to teach IDL classes when
you know it. I agree it is an important point, and I'll
store it some place in the back of my head (or in an obscure
corner of my web page), but I really think my explanation
is a GREAT DEAL more useful in practice! :-)
Cheers,
David
P.S. You should see the eyes glaze over when I start in
on CONTOUR plots. I wish I never knew there was such a
think as a "hole" in a filled contour plot! Or that
NLEVELS=15 gives you no such thing. :-(
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|