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

Home » Public Forums » archive » Square Brackets vs. Parentheses
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Square Brackets vs. Parentheses [message #22575] Fri, 24 November 2000 00:00 Go to next message
Eric Pilger is currently offline  Eric Pilger
Messages: 1
Registered: November 2000
Junior Member
I realize this may already have been covered, and I know they warned us
about this some time back. However, with one thing and another, and
skipping IDL 5.3 (because they never got around to sending it to us), we
are only now being hit with:

Square brackets are only for arrays. Parentheses are only for functions.

Needless to say, I have a user who has been playing loose with this
stuff for years. He now has hundreds of routines that use parentheses
for arrays AND functions, and are therefore broken under IDL 5.4. Does
anybody out there have a fix for this problem? Possibly a nice little
parser/translator that can figure out what's meant and stick in the
appropriate symbol :-) After all, IDL was doing it for years.

Thanks and aloha.

--
Eric J. Pilger
Systems Administrator
Hawaii Institute of Geophysics and Planetology/SOEST
pilger@pgd.hawaii.edu
(808)956-6321 (Voice/FAX)
Re: Square Brackets vs. Parentheses [message #22673 is a reply to message #22575] Fri, 24 November 2000 12:35 Go to previous messageGo to next message
landsman is currently offline  landsman
Messages: 93
Registered: August 1991
Member
In article <3A1EA3B6.A337AB1E@higp.hawaii.edu>, Eric Pilger <pilger@higp.hawaii.edu> writes...

> Needless to say, I have a user who has been playing loose with this
> stuff for years. He now has hundreds of routines that use parentheses
> for arrays AND functions, and are therefore broken under IDL 5.4. Does
> anybody out there have a fix for this problem? Possibly a nice little
> parser/translator that can figure out what's meant and stick in the
> appropriate symbol :-) After all, IDL was doing it for years.

The procedure idlv4_to_v5.pro in
http://idlastro.gsfc.nasa.gov/ftp/contrib/landsman/v5
(and supporting procedures (FDECOMP, MATCH, REMOVE, ISFUNCTION() )
is about 98% efficient in converting all indexing parentheses into
square brackets. It has occasional problems with continuation lines, and
indicies within strings (e.g. for an EXECUTE() statement).

--Wayne Landsman landsman@mpb.gsfc.nasa.gov
Re: Square Brackets vs. Parentheses [message #22674 is a reply to message #22575] Fri, 24 November 2000 13:30 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Eric Pilger (pilger@higp.hawaii.edu) writes:

> Square brackets are only for arrays. Parentheses are only for functions.
>
> Needless to say, I have a user who has been playing loose with this
> stuff for years. He now has hundreds of routines that use parentheses
> for arrays AND functions, and are therefore broken under IDL 5.4. Does
> anybody out there have a fix for this problem? Possibly a nice little
> parser/translator that can figure out what's meant and stick in the
> appropriate symbol :-) After all, IDL was doing it for years.

Square bracket notation is "suggested", even "preferred",
but not "required" at all. Why do you think so?

Best Regards,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Associate file type with IDL procedure?
Next Topic: LONG AND NARROW IMAGE

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

Current Time: Wed Oct 08 11:53:37 PDT 2025

Total time taken to generate the page: 0.00265 seconds