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

Home » Public Forums » archive » Re: Pass by value and performance
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: Pass by value and performance [message #46707 is a reply to message #46706] Wed, 14 December 2005 09:02 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
David Fanning wrote:
> Kenneth P. Bowman writes:
>
>
>> True, and I considered that possibility. It would work fine for passing
>> the arrays amongst my own routines, but I have to dereference the
>> pointer to pass the array itself into system routines. Dereferencing a
>> pointer is an expression, is it not?, and expressions are passed by
>> value.
>
>
> Ah, you would be interested to read the new pointer
> section of my book that I just completely yesterday!
> (Well, actually, you could read the damn pointer tutorial
> where I learned about this, too.) Here is the news that
> even I didn't fully appreciate until I put it down in my
> own words. Pointers are just regular IDL variables!!

In the context of this thread (and your example below), shouldn't one say that
/dereferenced/ pointers are just regular IDL variables (i.e. they're not expressions) ??

I don't think I'm splitting hairs here (or am I?)

>
> Consider this function:
>
> PRO JUNK, var
> var = var * 5
> END
>
> And do this:
>
> IDL> a = Ptr_New(5)
> IDL> junk, *a
>
> Here is the question. What is the result of this command?
>
> IDL> Print, *a
>
> The answer might surprise you! :-)

After my recent grokking of objects (thanks to that "object for dummies" website posted
earlier this month), the answer didn't surprise me as much it would of, but it's still a
good reinforcement.

It makes me wonder though - have IDL pointers always behaved that way, or is it a moving
target (ala relaxed structure definitions post IDL 5.3 talked about in another thread) ?

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: idl job posting
Next Topic: Recursive Function Program in IDL

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

Current Time: Fri Oct 10 01:50:39 PDT 2025

Total time taken to generate the page: 0.72061 seconds