Easy detection of a "False" tuple?

(imported topic written by MrFixit)

Is there an easy way to detect which item(s) or index value of a tuple group may be false?

for example: evaluation of something like (True;True;True;True;False;True;False) would return as a response 4 and 6. So I can ultimately only report the false values and ignore what is true.

I’ve gotten to this point with but what is the way to return the index or item value of those that are false?

q: (True;True;True;True;False;True;False) whose ( exists (it, (False)) whose ( item 0 of it is item 1 of it ))

A: False

A: False

thanks,

-Gary

(imported comment written by jessewk)

Couple of things.

Your query is using a list, not a tuple. Items in a list are separated with a semi-colon and all items in the list must share a type, while tuple items are separated by a comma and can be of different types.

You can’t inspect the index of a tuple item, but it doesn’t sound like that’s really what you want.

To get the item value, put your check for falseness in a whose clause. It’s hard to give you exact advice without a little more context as to exactly what you trying to do, but the syntax would basically be something like this:

Q: ( value 1; value 2; value 3 ) whose (not criteria 1 AND not criteria 2 AND not criteria 3)

As long as each of your criteria evaluate to True, only the values that don’t match the criteria would make it through the whose clause.

(imported comment written by MrFixit)

Sorry on multiple fronts.

I did know the difference in a list vs. a tuple and I posted my list version of what I was trying to achieve.

Also I really should have provided more information as to what I’m trying to achieve. This relevence is just part of a much larger and more complex relevence that is utilized in an analysis.

What I’m trying get to is a relevence that will inspect multiple values, say for this example mutiple lines in a .ini file and return a simple PASS if all lines are as expected (equal to a specific and expected value), if one or more lines are incorrect it returns the incorrect or missing values.

I exploring using some form of “indexing” of a tuple or list for “false or not pass” evaluations and then that index to retrieve that “item” for the reporting the bad value.

I look more at your reply but reversing it so it’s only reporting the values that do not pass inpection.

(imported comment written by jessewk)

I’d go with something along these lines:

(if (size of it > 0) then elements of it else “pass”) of set of lines whose (not passing) of file “c:\foo.ini”