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

Home » Public Forums » archive » Is this a bug?
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: Is this a bug? [message #13050 is a reply to message #12978] Fri, 02 October 1998 00:00 Go to previous messageGo to previous message
J.D. Smith is currently offline  J.D. Smith
Messages: 214
Registered: August 1996
Senior Member
menakkis@my-dejanews.com wrote:
>
> David Foster <foster@bial1.ucsd.edu> wrote:
> <...>
>> ((*p).s.a)[2] = ((*p).s.a)[2] * 4
>> % Temporary variables are still checked out - cleaning up...
>>
>> print, ((*p).s.a)[2]
>> 48 ; Value was not adjusted
>
< SNIP >
> Perhaps like me you're a bit uneasy about having to put brackets around
> dereferenced pointers to get at structure members or array elements therein.
> It really does go against the grain, doesn't it? Any superfluous brackets
> and you get this "calculation mode" thing kicking in. I must say that I
> can't see a way around this, though, given what I gather about how IDL's
> variables work. I guess an interpretation of what (*p) means is: "make a
> temporary variable *control* structure to get at the contents of p"; you can
> then use the "thing" (*p) as if it was a variable name. It takes some
> getting used-to, but it *is* very efficient for dereferencing just an array
> element or structure member. (I was going to sound forth on how I dislike
> this syntax but had second thoughts.)


I would interpret (*p) as "lookup and use the heap variable pointed to
by p". This is for all purposes the same meaning as *p, because a
temporary copy of a heap variable is not well-defined, since heap
variables are global and long-lived by definition. That is, even if IDL
is making a temporary copy of whatever internal variable (likely a C
pointer) is tied to <PtrHeapVar1>, this is just as valid a reference to
the global heap as *p. It is unclear if *p vs. (*p) actually elicits
different internal handling by IDL (with perhaps more overhead for the
latter). Even if so, however, it will not make any difference to our
usage. In this context the ambiguity is not as alarming.

JD

--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How do you like this?
Next Topic: Copying IDL objects

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

Current Time: Sat Oct 11 10:10:54 PDT 2025

Total time taken to generate the page: 0.88202 seconds