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

Home » Public Forums » archive » Re: Which like command for IDL?
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: Which like command for IDL? [message #23091 is a reply to message #23090] Fri, 05 January 2001 07:21 Go to previous messageGo to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
I hate to be a one tune band, but the best way I have of doing this kind
of shadow mapping (finding files defining procedures which shadow each
other), is with IDLWAVE. Why is this superior to anything offered
internally in IDL?

For one, it doesn't need IDL! It uses it's own notion of IDL builtins,
system library files (the ones in !DIR/lib), and the user catalog it
scanned. If IDL is running in the shell, it also queries it for all
routine info. Since I've scanned into my catalog almost everything on
!PATH (IDLWAVE makes it trivial), I can easily see which files define a
procedure. I can even do a full shadow scan of the entire system, or
all routines in the current buffer, or all routines compiled in the
shell.

The most trivial way to see multiple sources, however, is with routine
info (which you'll probably be using for other things all the time
anyway). For instance, here's the routine info (invoked via [C-c ?]
when near a pro/func), for print, which I've unwisely redefined several
times:

Usage: PRINT [, Expr1, ..., Exprn]
Keywords: AM_PM DAYS_OF_WEEK FORMAT MONTHS REWRITE STDIO_NON_FINITE
Sources: - Builtin
- Other [-SB] ~/foo.pro
- Library [C--] ~/idl/scrap/print.pro
- Library [C--] ~/idl/scrap/printf.pro


We see 4 sources, in order of likelihood of usage. Here, the built-in
print is always used. You can't override it. Then we have a file
foo.pro in a buffer I'm visiting (the B), which has a version of "print"
compiled in the shell (S) (will I never learn). Then there's a pair of
"Library" files (which just means they're in !PATH), which have been
scanned and put into my catalog "C".

What about something you can override? How about one of the !DIR/lib
procedures which comes with IDL? Here's an example shadow listing for
one of those (notice it's the same as routine info, but without the
usage/keyword stuff).

ValidateManagedWidgets
- SystemLib [C--] /usr/local/rsi/idl/lib/xmanager.pro
- Library [C--] ~/idl/scrap/xmanager.pro

So, I've redefined ValidateManagedWidgets somewhere, but ~/idl comes
after !DIR/lib on the !PATH, so it won't ever be automatically
compiled. How cheeky.

You get the idea. You can also find out interesting things about your
path ordering, like:

CW_COLOR_INDEXE()
- Obsolete [C--] /usr/local/rsi/idl/lib/obsolete/pwidget.pro
- SystemLib [C--] /usr/local/rsi/idl/lib/cw_clr_index.pro

I.e. this file defines cw_color_indexe in obsolete, and is on the path
before cw_clr_index. Which one gets called depends on which one of
these .pro's gets compiled, but if the first is compiled before the
second, that's a silent routine shadow... watch out.

Oh by the way, middle clicking on any of the .pro's listed above would
take you immediately to the routine definition in the source code, so
you can see for yourself with no fuss why you thought you'd override
print, for instance.

Good luck,

JD
[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
Previous Topic: Re: Map projection and object graphics
Next Topic: Re: GIF again.....

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

Current Time: Sat Oct 11 03:23:30 PDT 2025

Total time taken to generate the page: 1.92603 seconds