Next: , Previous: Conditions, Up: Conditions


6.5.1 The Operators `=' and `/='

The condition expr1 = expr2 tests whether the expressions expr1 and expr2 are equal. There are several possibilities:

expr1 and expr2 are strings, symbols or numbers.
In this case expr1 and expr2 must be identical.
expr1 and expr2 are lists.
In this case expr1 and expr2 must match element by element.
expr1 and expr2 are records.
In this case expr1 and expr2 must contain the same attributes (though not necessarily in the same order) as in expr2.

For nested structures, equality is tested recursively.

If expr1 and expr2 do not have the same type, the test results in an error; only the symbol nil can be compared to any value.

The comparison expr1 /= expr2 holds iff the comparison expr1 = expr2 does not hold.