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

Home » Public Forums » archive » Re: do I really need to use loops on objects?
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: do I really need to use loops on objects? [message #18081 is a reply to message #18078] Wed, 01 December 1999 00:00 Go to previous messageGo to previous message
bjackel is currently offline  bjackel
Messages: 10
Registered: September 1993
Junior Member
Brad Gom wrote:
>
> It seems odd to me that I can't treat object arrays with the same
> elegance that is possible with all other array types. If I have a large
> list of objects of the same type, and I want to call the same method on
> each of them, do I really have to use a for loop? Wouldn't it be more
> consistent with the IDL philosophy to write: object_array->method()
> instead of: for i=0,10 do object_array[i]->method()

I agree completely, but most people on this group don't appear to.

The counter argument seems to be that an object array can contain
different kinds of objects, so you can't be sure that any particular
method will work for every element of the array. While true, this
seems (to me) to be a reason why object arrays should contain only
similar elements *JUST LIKE EVERY OTHER IDL ARRAY TYPE*. If you
want different kinds of objects wrapped up together then use an
array of pointers, or a structure with different object members.

However, it is unlikely that RSI will make any significant change
to object arrays, so we might as well get used to more loops. Ugh.

Brian
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How does REFORM work in PV-Wave
Next Topic: Re: Copying objects

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

Current Time: Sat Oct 11 04:02:36 PDT 2025

Total time taken to generate the page: 0.72081 seconds