6.4. Comparison Operators

The following standard comparison operators are supported in GEL and have the obvious meaning: ==, >=, <=, !=, <>, <, >. They return true or false. The operators != and <> are the same thing and mean "is not equal to". GEL also supports the operator <=>, which returns -1 if left side is smaller, 0 if both sides are equal, 1 if left side is larger.

Normally = is translated to == if it happens to be somewhere where GEL is expecing a condition such as in the if condition. For example

if a=b then c
if a==b then c
are the same thing in GEL. However you should really use == or := when you want to compare or assign respectively if you want your code to be easy to read and to avoid mistakes.

All the comparison operators (except for the <=> operator which behaves normally), are not strictly binary operators, they can in fact be grouped in the normal mathematical way, e.g.: (1<x<=y<5) is a legal boolean expression and means just what it should, that is (1<x and x≤y and y<5)

To build up logical expressions use the words not, and, or, xor. The operators or and and are special beasts as they evaluate their arguemnts one by one, so the usual trick for conditional evaluation works here as well. For example, 1 or a=1 will not set a=1 since the first argument was true.