comparison operators for lists?

Sep 8, 2009 at 6:40am

comparison operators for lists?

i’m probably overlooking something, but i just can’t find < , >, < = or >= for lists anywhere, though i thought Lobjects contains them…

#45380
Sep 8, 2009 at 6:52am

Maybe a silly reply, but what do you mean by < , >, < = or >= for lists? What would generate a positive result…. if all items in one list were less than all items in another, for example?

If you’re trying to test out if a list is different to another list, you can do a number of things with [zl compare], [zl change] etc.

#163571
Sep 8, 2009 at 7:10am

i want to check if each element of a list is greater or lesser then the corresponding elements of another list.

eg ’1 2 3 4′ > ’4 3 2 1′ would give ’0 0 1 1′

differences in length are not really an issue for me, as the lists will always have the same length.

#163572
Sep 8, 2009 at 7:14am

The vexpr object does this.

_
johan

#163573
Sep 8, 2009 at 7:28am

thanks johan

#163574
Sep 8, 2009 at 1:37pm

indeed. [vexpr ($f1==$f2)] will return true or false.

#163575

You must be logged in to reply to this topic.