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

Home » Public Forums » archive » Re: Loop Arrays
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: Loop Arrays [message #26977] Tue, 09 October 2001 12:59 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
From: "Ken Mankoff" <mankoff@lasp.colorado.edu>
> I am interested in creating circular arrays, where subscripts that would
> be out-of-bounds on a regular array just start indexing on the other side
> of the array.

> I think that overloading the [] operators is not an option from my
> understanding of IDL. Does anyone know if this is possible?

It's not possible. IDL does not support operator overloading.

> Desirable? Dumb?

Maybe. No.

You can do quite a lot with ordinary arrays using arrays of indices, eg

a = indgen(10)
print, a[ [0,10,20,100] mod n_elements(a)]

BTW another indexing extension that appeals to me is Python's use of
negative indices to refer to positions relative to the end of the array,
eg -1 refers to the rightmost element.

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research



--
Posted from clam.niwa.cri.nz [202.36.29.1]
via Mailgate.ORG Server - http://www.Mailgate.ORG
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Mac OSX
Next Topic: IDL and XML

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

Current Time: Wed Oct 08 16:20:43 PDT 2025

Total time taken to generate the page: 0.00255 seconds