Re: Pointer syntax and IDL 4.0: summary [message #28591 is a reply to message #28533] |
Thu, 20 December 2001 09:39  |
tam
Messages: 48 Registered: February 2000
|
Member |
|
|
tam wrote:
>
...
> Is there any way of addressing this, i.e., dereferencing a pointer
> in a way that will not cause a syntax error for earlier versions of IDL?
> Thanks,
> Tom McGlynn
> tam@lheapop.gsfc.nasa.gov
>
Thanks to all who wrote responses. I'm not sure any do quite what I want
but I now have a set of options...
1. I can just forget about backwards compatibilility with the old
code -- figure v4 users can use earlier versions of my code.
2. Use library routines, like Liam Gumley's, which hide the derefenence
in a single function call and hope that V4 users don't explicitly try to
compile that function. In Liam's code the Pointer_setgetv5 routine
has the dereference syntax. It means that the user has to download
at least two separate files.
3. Use execute to do all dereferences in run-time compiled code.
This works fine but may be inefficient in some cases since the routines
may be called millions of times. It's not as bad as I originally
thought though... Millions would be a rare case and I seem to get
about 20K execute calls per second which would mean the overhead
would be negligible most of the time.
4. Use run-time compilation (a la 3) but compile a function (as in 2) to do
the dereference. This would be nice since it would combine
efficiency and common v4/v5 code. Alas I can't get execute to compile
a function, so this requires creating
a temporary file -- and that's a real pain. Does anyone know how/if you
can compile a function in execute (or more generally without
reference to a physical file)? I'm hoping there's some devious
route around the limits that IDL seems to have here.
Thanks for the help,
Regards,
Tom McGlynn
|
|
|