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

Home » Public Forums » archive » Re: structures still confusing
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: structures still confusing [message #49069] Tue, 13 June 2006 09:33 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Tue, 13 Jun 2006 09:13:49 +0100, Allan Whiteford wrote:

> Martin,
>
> print,(s.m)[0]
>
> is probably less confusing.

But alas, way less efficient, since to access just that one element, it
creates an (arbitrarily large) temporary vector (s.m). I don't
specifically cover multi-dimensional struct slices, but some info on
precedence etc. can be found in:

http://www.dfanning.com/misc_tips/precedence.html

The basic hint here is that structure dereference and array dereference
are at the same level of precedence, and don't step on eachother's toes
(both left-right associative), so unless you have pointers mixed in, you
shouldn't need *any* parentheses to get to an arbitrarily deeply nested
array of structure of structure of array of ... and if you do have
pointers mixed in, you just need a *single* pair of parentheses around
each and every pointer expression (except a top level pointer). Though
they result in bizarre looking expressions, the rules are quite simple.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: procedure name quirk
Next Topic: Using Windows IDL to access a UNIX database using DLM's

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

Current Time: Wed Oct 08 13:31:50 PDT 2025

Total time taken to generate the page: 0.00400 seconds