C syntax for IDL [message #7589] |
Thu, 05 December 1996 00:00  |
martin
Messages: 18 Registered: January 1993
|
Junior Member |
|
|
I program mostly in IDL, but every once and a while I program in C. I find
the switch to be unnecessarily painful. What I would really like is an
alternative syntax for IDL that would be C-like. For example:
for i=0,10 do begin
x(i)=i
endfor
Could become
for (i=0; i<10; i++) {
x[i]=i
}
It seems like the mapping from one syntax to the other is pretty straight
forward. You could put a command at the beginning of each program to tell
it which interpretter to use.
This alternative syntax would be helpful to me in 2 ways. First, it would
help me keep my C programing skills alive. Second, it would help me
recruit the assistance of C programmers here where I work.
This would also solve that function-array ambiguity that everyone else is
talking about.
Charles Martin
University of Texas
|
|
|
Re: C syntax for IDL [message #7686 is a reply to message #7589] |
Wed, 11 December 1996 00:00  |
David Fenyes
Messages: 10 Registered: November 1996
|
Junior Member |
|
|
martin@uthscsa.edu (Charles Martin) writes:
>
> I program mostly in IDL, but every once and a while I program in C. I find
> the switch to be unnecessarily painful. What I would really like is an
> alternative syntax for IDL that would be C-like. For example:
>
> for i=0,10 do begin
> x(i)=i
> endfor
>
>
> Could become
>
> for (i=0; i<10; i++) {
> x[i]=i
> }
>
If this is what you want, then try yorick. It has syntax very much
like C, with all of the array-handling capabilities of IDL, and
probably better numerical libraries (LAPACK, etc. vs. Numerical
Recipes) However, it doesn't have quite the array of functions that
IDL has, and is weaker on graphing, file formats, etc.
Personally, I don't understand why, given the obvious similarities
between IDL and lisp, RSI doesn't provide a lisp syntax as an
alternative. The current kludgy syntax could easily be compiled into
lisp, and would also provide a path to producing compiled binaries
using a linkable runtime library.
--
David Fenyes University of Texas Medical School
dave@msrad71.med.uth.tmc.edu Dept. of Radiology
|
|
|
Re: C syntax for IDL [message #7697 is a reply to message #7589] |
Tue, 10 December 1996 00:00  |
Uwe Knorr
Messages: 2 Registered: August 1996
|
Junior Member |
|
|
Charles Martin wrote:
>
> I program mostly in IDL, but every once and a while I program in C. I find
> the switch to be unnecessarily painful. What I would really like is an
> alternative syntax for IDL that would be C-like. For example:
>
> for i=0,10 do begin
> x(i)=i
> endfor
>
> Could become
>
> for (i=0; i<10; i++) {
> x[i]=i
> }
>
/* a few lines later */
>
> Charles Martin
> University of Texas
You took the words right out of my mouth ...
As a (mainly) C programmer it always takes me a while to switch to IDL.
(And if you do some perl in between, you may go crazy)
My tip:
Copy & Paste the HandiGuide (using a copy-machine and some glue) to your
needs.
If someone will ever change the syntax, please please be
consistant. If degree to radiant is !DTOR , then
why is the reverse !RADEG (and not !RTOD) ?
But nevertheless, if you once get used to the syntax (and
you have the HandiGuide at your fingertips)
you have a fantastic product ;-)
Uwe Knorr
----------------------------------------------------
\ Uwe Knorr
\ MNR-Klinik / Neurologie / Uni Duesseldorf
\ mailto:knorr@neurologie.uni-duesseldorf.de
\ http://www.neurologie.uni-duesseldorf.de/~knorr/
----------------------------------------------------
|
|
|