< Back to IRCAM Forum

Filtering a list where the order is kept

Dear Karim, I’ve tried to find out of this.

Let’s say we have this list:
(3 10 1 13 15 5 5 10 11 9 11 2 11 4)
And I would like to achieve this list thru filtering.
(3 1 5 5 9 2 4)

Best, Dagfinn

Dear Dagfinn,

here you are assuming that what you really want to do is filter all elements below 10:

The patch:
Patch 25.omp (4.0 KB)

Best
K

Hello,

Just to add another option, filter-list is handy in many occasions where a lambda could help

image

best
rc

Dear Karim, thank you! Me exploring OM-Loop is overdue, so this is very inspiring to do it.

Best, Dagfinn

Hello RC, thanks a lot! Elegant solution for me that have been ‘avoiding’ the OM-Loop since I begun learning the software back in 2000. But I think I have to dive into it.

Best, Dagfinn