INPUT /  OUTPUT /  LANGUAGE






eq tag

Transient logic tag

Tests multiple values in a list for equality and obtains the result.

Sample usage

<eq 1,1> generates true. <eq 1,2> generates false. <eq 10, 10, 10> generates true.

Fields

Primary field

A list of values to be compared.

Secondary fields

Behaviour

The equality test is true if all the values in the list are equal. The result is false if one of the values differs, and invalid if fewer than two values are provided for comparison.

Values will also evaluate as being equal if they have the same value but different types. For example, 0 is equal to literal values null and false, and all nonzero numbers are equal to true. See also the tags: true, false, null, invalid which can be used to test for a literal match.

Notes

Note that you cannot compare two vectors (e.g. v1 and v2) using the eq tag in the way you would compare two ordinary values. This behaviour is due to the way ioL will expand out a vector assigned to a field, to form part of the list of values assigned to that field.

<v1:vector 1,2,3>
<v2:vector v1>
<eq v1,v2>

Here, even though v1 and v2 contain the same values, the above example generates false since the equality is tested as <eq 1,2,3,1,2,3> and the values differ.

Example