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

Home » Public Forums » archive » objarr
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: objarr [message #17075 is a reply to message #16982] Fri, 03 September 1999 00:00 Go to previous message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
In article <MPG.1238930f48dc31b9898da@news.frii.com>
davidf@dfanning.com (David Fanning) writes:
>
> bjackel@phys.ucalgary.ca (bjackel@phys.ucalgary.ca) writes:
>
>> Am I correct in fearing that the only
>> way to get what I want is with something like this?
>>
>> magpile= DBLARR(N_ELEMENTS(pile))
>> FOR indx=0,N_ELEMENTS(pile)-1 DO magpile[indx]=
>> pile[indx]->magnitude()
>
> I'm afraid so. :-(

And I don't blame RSI for making it so. Just think about
it - an object array can be pointing to as many different
object types as the number of elements. There's no guarantee
that all of them have the particular method in question.
This goes for procedure methods as well as function methods.

Further, even if all the objects are of a single type,
a function method may return wildly different types of
results, depending on the internal state of the object!
So, there's no way for IDL to guess the type of array
needed to store the result.

OK, so there are ways to circumvent this, like determining
the type after all calls have been made. But, the scenario
also introduces a tricky problem with e.g. error reporting.
I guess you'd only get messages like

% Attempt to call undefined method: 'BLAH::MAGNITUDE()'

and various type conversion errors..

But I agree, it's annoyingly different from what we're used
to.

Regards,

Stein Vidar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: 3D irregular tetraedal grid generation
Next Topic: IDL 5.1.1: Going from True_Color to Pseudo_Color on one session

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

Current Time: Wed Oct 15 09:49:39 PDT 2025

Total time taken to generate the page: 1.20054 seconds