Julien Flack wrote:
>
> I am very impressed with a number of features of IDL. However, I think
> that its lacking support for structure (primarily data structures) due to
> its historical affiliation with Fortran (no flames please). This weakness
> becomes noticable when you reach a 3,000+ line application (IMHO).
>
> I think that a version of IDL using object based/oriented technology would
> be immensely powerful and would reach a far wider audience. Is there a
> desire for OO technology in the scientific community, or is Fortran still
> predominant ? Have RSI made any moves in this direction ?
>
> Any news, views and gossip welcome ...
>
> --
> Julien.
Am I missing something here? I enclose a snippet of a code which
I believe does have structures (Very similar to Fortran-90--no more flames, please)
; Grid_Index : an i,j pair
Gi = { GRID_INDEX , I: LONG(0), J:LONG(0) }
; Point_t: an (x,y) pair
pt = { POINT_T, X: 1.0 , Y: 1.0 }
; Poly8_t number of points, then space for up to 8 points
P8 = { POLY8_T, N: LONG(0), VERT: REPLICATE(pt,8) }
; Grid record, key index, Grid index, polygon, area
GR = { GRID_REC, ID : LONG(0), G : Gi , P: P8 , AREA : 1.0 }
plot,[-180,180],[-90,90],/nod
nrecs = LONG(0)
openr, iu, 'grid1.db', /f77,/GET_LUN
readu, iu, nrecs
rec = gr
for i=0,nrecs-1 do begin
readu, iu, rec
plots, rec.p.Vert(0:4).x,rec.p.Vert(0:4).y
endfor
free_lun,iu
end
Now if you want to discuss encapsulation and inheritance, I agree,
IDL is not OOP, but these are data structures, and they are very
easy to use, and you can write functions for them, etc. etc.
BTW, a 3000 line IDL app is EXTREMELY long.
--
Paul Schopf mailto://schopf@gsfc.nasa.gov
Coupled Climate Dynamics Group/971 http://ccdg.gsfc.nasa.gov/~paul
NASA Goddard Space Flight Center
Greenbelt, MD 20771
|