< Back to IRCAM Forum

Omloop problem

Hello,

I’m encountering some strange behaviour working with om-loop and a recursive patch.
It seems that om-loop evaluates the input in a strange sequence, which means that using conditionals within an omloop is problematic.

If you evaluate the attached problem patch (just an example of the behaviour I’m encountering) you’ll see that the error is due to the OMIF not behaving as expected.
Or am I doing something wrong?

best,

jc

do-something.omp (4.7 KB)

=> the listloop iterator input in a loop is initialized before the omif test is performed

in your case (listloop (cdr input)) will return an error if input is not a list

a workaround could be to either test ‘input’ with an other omif and listp,
or to force the type of input to list using list!