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

Home » Public Forums » archive » Re: "foreach" loops in IDL
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: "foreach" loops in IDL [message #64789] Mon, 19 January 2009 02:31 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
rtk schrieb:
> On Jan 16, 11:30 am, alaniwiuse...@googlemail.com wrote:
>> In case anyone's interested, I've produced a little hack that lets you
>> have "foreach" loops in IDL
>
> Neat hack!
>
> Along the same lines, I have a set of DLMs here that add things like
> foreach, map, filter, reduce, etc. to IDL along with lambda functions
> and lists:
>
> http://www.ittvis.com/info/hof/
>
> For example, with the foreach DLM, your example becomes:
>
> foreach, lambda('x: print, x', /P), myarray
>
> There is also a pure IDL version for functions called 'each()' which
> is quite useful.
>
> Map, filter and reduce work pretty much as they do in Python (with
> extensions). There are also compose, apply, cart, accumulate, and
> group higher-order functions. With cart() it is possible to do the
> equivalent of Python list comprehensions.
>
> If you try it and have any questions let me know.
>
> Ron
> oneelkruns@hotmail.com
>

Some more hacks and we can call it python

cheers
Reimar

/me lives in both worlds already
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: ERRPLOT using object Graphics .... ?
Next Topic: Contour command

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

Current Time: Wed Oct 08 15:37:08 PDT 2025

Total time taken to generate the page: 0.00428 seconds