CLEM operators
Last updated: Feb 11, 2025
This page lists the available CLEM language operators.
Operation | Comments | Precedence (see next section) |
---|---|---|
|
Used between two CLEM expressions. Returns a value of true if either is true or if both are true. | 10 |
|
Used between two CLEM expressions. Returns a value of true if both are true. | 9 |
|
Used between any two comparable items. Returns true if ITEM1 is equal to ITEM2. | 7 |
|
Identical to . |
7 |
|
Used between any two comparable items. Returns true if ITEM1 is not equal to ITEM2. | 7 |
|
Identical to . |
7 |
|
Used between any two comparable items. Returns true if ITEM1 is strictly greater than ITEM2. | 6 |
|
Used between any two comparable items. Returns true if ITEM1 is greater than or equal to ITEM2. | 6 |
|
Used between any two comparable items. Returns true if ITEM1 is strictly less than ITEM2 | 6 |
|
Used between any two comparable items. Returns true if ITEM1 is less than or equal to ITEM2. | 6 |
|
Used between two integers. Equivalent to the Boolean expression INT1 && INT2 = 0. | 6 |
|
Used between two integers. Equivalent to the Boolean expression INT1 && INT2 /= 0. | 6 |
|
Adds two numbers: NUM1 + NUM2. | 5 |
|
Concatenates two strings; for example,
. |
5 |
|
Subtracts one number from another: NUM1 - NUM2. Can also be used in front of a number: - NUM. | 5 |
|
Used to multiply two numbers: NUM1 * NUM2. | 4 |
|
Used between two integers. The result is the bitwise 'and' of the integers INT1 and INT2. | 4 |
|
Used between two integers. The result is the bitwise 'and' of INT1 and the bitwise complement of INT2. | 4 |
|
Used between two integers. The result is the bitwise 'inclusive or' of INT1 and INT2. | 4 |
|
Used in front of an integer. Produces the bitwise complement of INT. | 4 |
|
Used between two integers. The result is the bitwise 'exclusive or' of INT1 and INT2. | 4 |
|
Used between two integers. Produces the bit pattern of INT shifted left by N positions. | 4 |
|
Used between two integers. Produces the bit pattern of INT shifted right by N positions. | 4 |
|
Used to divide one number by another: NUM1 / NUM2. | 4 |
|
Used between two numbers: BASE ** POWER. Returns BASE raised to the power POWER. | 3 |
|
Used between two integers: INT1 rem INT2. Returns the remainder, INT1 - (INT1 div INT2) * INT2. | 2 |
|
Used between two integers: INT1 div INT2. Performs integer division. | 2 |
Operator precedence
Precedences determine the parsing of complex expressions, especially unbracketed expressions with more than one infix operator. For example,
3 + 4 * 5
parses as
rather than 3 + (4 * 5)
because the relative precedences dictate that (3 + 4) *
5
is to be parsed before
*
. Every operator in the CLEM language has a precedence value associated with it;
the smaller this value, the more important it is on the parsing list, meaning that it will be
processed sooner than other operators with larger precedence values. +
Was the topic helpful?
0/1000