From 346480346effb86406b7c4cc5d51cd857f275ca2 Mon Sep 17 00:00:00 2001 From: "Heinz N. Gies" Date: Wed, 27 Sep 2023 11:30:18 +0200 Subject: [PATCH] Update operators Signed-off-by: Heinz N. Gies --- docs/language/expressions.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/language/expressions.md b/docs/language/expressions.md index 55aacdf3..bd1e1d03 100644 --- a/docs/language/expressions.md +++ b/docs/language/expressions.md @@ -243,20 +243,25 @@ See also: List of binary and unary operators in Tremor, ordered by precedence (from low to high): +### Binary Operators + | Symbol | Name | Example | Types | Fold Support | |--------------|-----------------------------------------------|---------------------------------------------------------|--------------------------------|--------------| -| or | Logical OR | `true or false` | bool | no | -| and | Logical AND | `true and false` | bool | no | +| or | Logical OR (short circuiteing) | `true or false` | bool | yes | +| and | Logical AND (short circuiteing) | `true and false` | bool | yes | +| xor | Logical XOR | `true xor false` | bool | yes | | \| | Bitwise OR | _Bitwise OR has not been implemented yet_ | - | no | | ^ | Bitwise XOR | `42 ^ 42, true ^ true` | integer, bool | yes | | & | Bitwise AND | `42 & 0, true & false` | integer, bool | yes | | ==, != | Equality, Inequality | `"snot" != "badger"` | all | no | | <, <=, >, >= | Comparison Operators | `42 > 0` | integer, float, string, binary | no | -| <<, >>, >>> | Bitwise shift: Left, Right(signed & unsigned) | `42 >> 2` | integer | no | +| <<, >>, >>> | Bitwise shift: Left, Right(signed & unsigned) | `42 >> 2` | integer | yes | | + | Addition | `42 + 0` | all | yes | | - | Subtraction | `42 - 0` | integer, float, string | yes | | \*, / | Multiplication, Division | `42 * 1` | integer, float | yes | | % | Modulus | `42 % 2` | integer | yes | + +### Unary Operators | +, - | Unary Plus, Unary Minus | `-42` | integer, float | no | | not , ! | Unary Logical NOT, Unary Bitwise NOT | `not false`, _Bitwise NOT has not been implemented yet_ | bool | no |