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

Home » Public Forums » archive » Happy Reasons to use IDL 8.1
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: Happy Reasons to use IDL 8.1 [message #76346 is a reply to message #76218] Wed, 25 May 2011 01:42 Go to previous messageGo to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Tue, 24 May 2011, David Fanning wrote:

> FĂ–LDY Lajos writes:
>
>> Probably IDL does not know about your image function and tries to
>> subscript the image variable. Does compile_opt idl2 help?
>
> Well, this occurs in a fresh IDL session, so image
> is undefined. I've also checked to be sure no procedures
> or functions named "image" are defined.
>
> IDL> .reset
> IDL> .compile -v 'C:\IDL\default\junk.pro'
>
> img = image(image, /current)
> ^
> % Syntax error.
> At: C:\IDL\default\junk.pro, Line 4
> % 1 Compilation error(s) in module $MAIN$.
>
> Yes, Compile_Opt idl2 helps and seems to solve
> the problem. Yet one more reason (if we need one!)
> that this should finally be the default behavior!
>
> The fact that I know how to work-around the problem
> (naming my image "bob" also solves the problem!) doesn't
> give me much satisfaction. What do you suppose the
> problem is?
>

The problem is that image() is ambiguous, it can be a function call or a
variable subscript. IDL must choose after reading the tokens 'image' '('.
I guess the rules are:

- if the image function is defined, it is a function call

- if the image variable is defined, it is a subscript

- if the image function can be resolved using !PATH, it is a function call

- it is a subscript

(here defined means defined in the internal tables of the compiler)

I think we have to live with it. "bob" or compile_opt idl2 (strictarray)
removes the ambiguity. Probably IDL should add an -idl2 command line
switch to make it default globally.

regards,
Lajos
[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: graphics window
Next Topic: command in matlab analogous to scope_varname?

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

Current Time: Wed Oct 08 17:47:37 PDT 2025

Total time taken to generate the page: 0.00447 seconds