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

Home » Public Forums » archive » Re: IDLgrLegend broken
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: IDLgrLegend broken [message #22814 is a reply to message #22793] Thu, 07 December 2000 12:21 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"David Fanning" <davidf@dfanning.com> wrote in message
news:MPG.14996ac0b9d231b2989cb0@news.frii.com...

Responding to David's post, and his quote from Pavel's post, which I have
not yet seen:

Pavel, quoted by David:
>> I think the only really generic solution is *saving each method in a
>> separate file*.

I think that this is not a good idea, because of this rule:

IDL searches--all the way up the inheritance tree--in memory before
searching on the disk. (For performance reasons, obviously.)

So if we have a class MyClass with a method SomeMethod stored in a file
myclass__somemethod.pro then the first time IDL wants to call SomeMethod on
a MyClass object it may find and compile myclass__somemethod.pro, but *only*
if the search through the already-compiled functions in memory fails to find
a SomeMethod associated with one of MyClass's superclasses.

The reason for storing all object methods in myclass__define.pro is that
myclass__define is always called (and so myclass__define.pro is always
compiled) when the first instance of MyClass is created. (Unless you get
sneaky and try to restore MyClass from disk.)

David:
> But before I did this, I'd have a closer read of this
> article, where JD and I (and probably Mark) discussed
> this restore object problem and came up with a
> "sorta" solution:
>
> http://www.dfanning.com/tips/saved_objects.html

Hey nice one David. I don't know that I can claim any of the credit or blame
for this article. I have read it before and I should have remembered its
existence before posting very similar material.

A comment/question on the RESOLVE_OBJ routine that's shown at the above
link:

The following code snippet ensures that each object's __define procedure is
called only if it has not already been compiled. (The array ri holds a list
of currently compiled routines, generated by a call to ROUTINE_INFO.)

if (where(ri eq defpro))[0] eq -1 then begin
;; Compile and define the class.
call_procedure,defpro
endif

My comment is: why bother? Once a __define method has been called once,
further calls have no effect.

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: postscript file sizes
Next Topic: GAUSS2DFIT - TILT ?

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

Current Time: Wed Dec 03 19:49:39 PST 2025

Total time taken to generate the page: 1.04805 seconds