Doc: bitwise operators in the main operator table and special assignment operators table
This commit is contained in:
+42
-8
@@ -737,7 +737,7 @@ The table below shows all supported operators by decreasing priorities.
|
||||
.Operators priorities
|
||||
[cols="^3,^2,^2,^5,^6"]
|
||||
|===
|
||||
| Priority | Operators | Position | Operation | Operands and results
|
||||
| Priority | Operator | Position | Operation | Operands and results
|
||||
|
||||
.2+|*ITEM*| [blue]`[`...`]` | _Postfix_ | _List item_| _list_ `[` _integer_ `]` -> _any_
|
||||
| [blue]`[`...`]` | _Postfix_ | _Dict item_ | _dict_ `[` _any_ `]` -> _any_
|
||||
@@ -751,6 +751,8 @@ The table below shows all supported operators by decreasing priorities.
|
||||
.3+|*SIGN*| [blue]`+`, [blue]`-` | _Prefix_ | _Change-sign_| (`+`\|`-`) _number_ -> _number_
|
||||
| [blue]`#` | _Prefix_ | _Lenght-of_ | `#` _collection_ -> _integer_
|
||||
| [blue]`#` | _Prefix_ | _Size-of_ | `#` _iterator_ -> _integer_
|
||||
.2+|*BIT SHIFT*| [blue]`<<` | _Infix_ | _Left-Shift_ | _integer_ `<<` _integer_ -> _integer_
|
||||
| [blue]`>>` | _Infix_ | _Right-Shift_ | _integer_ `>>` _iterator_ -> _integer_
|
||||
.2+|*SELECT*| [blue]`? : ::` | _Multi-Infix_ | _Case-Selector_ | _any-expr_ `?` _case-list_ _case-expr_ `:` _case-list_ _case-expr_ ... `::` _default-expr_ -> _any_
|
||||
| [blue]`? : ::` | _Multi-Infix_ | _Index-Selector_ | _int-expr_ `?` _case-expr_ `:` _case-expr_ ... `::` _default-expr_ -> _any_
|
||||
.1+|*FRACT*| [blue]`:` | _Infix_ | _Fraction_ | _integer_ `:` _integer_ -> _fraction_
|
||||
@@ -767,9 +769,9 @@ The table below shows all supported operators by decreasing priorities.
|
||||
| [blue]`+` | _Infix_ | _Dict-join_ | _dict_ `+` _dict_ -> _dict_
|
||||
| [blue]`-` | _Infix_ | _Subtraction_ | _number_ `-` _number_ -> _number_
|
||||
| [blue]`-` | _Infix_ | _List-difference_ | _list_ `-` _list_ -> _list_
|
||||
.1+|*BINARY NOT*| [blue]`~` | _Prefix_ | _Binary Not_ | `~` _number_ -> _number_
|
||||
.1+|*BINARY AND*| [blue]`&` | _Infix_ | _Binary And_ | _number_ `&` _number_ -> _number_
|
||||
.1+|*BINARY OR*| [blue]`\|` | _Infix_ | _Binary Or_ | _number_ `\|` _number_ -> _number_
|
||||
.1+|*BITWISE NOT*| [blue]`~` | _Prefix_ | _Binary Not_ | `~` _number_ -> _number_
|
||||
.1+|*BITWISE AND*| [blue]`&` | _Infix_ | _Binary And_ | _number_ `&` _number_ -> _number_
|
||||
.1+|*BITWISE OR*| [blue]`\|` | _Infix_ | _Binary Or_ | _number_ `\|` _number_ -> _number_
|
||||
.8+|*RELATION*| [blue]`<` | _Infix_ | _Less_ | _comparable_ `<` _comparable_ -> _boolean_
|
||||
| [blue]`\<=` | _Infix_ | _less-equal_ | _comparable_ `\<=` _comparable_ -> _boolean_
|
||||
| [blue]`>` | _Infix_ | _Greater_ | _comparable_ `>` _comparable_ -> _boolean_
|
||||
@@ -785,15 +787,47 @@ The table below shows all supported operators by decreasing priorities.
|
||||
| [blue]`\|\|` | _Infix_ | _Or_ | _boolean_ `\|\|` _boolean_ -> _boolean_
|
||||
.2+|*INSERT*| [blue]`+>` | _Infix_ | _Prepend_ | _any_ `+>` _list_ -> _list_
|
||||
| [blue]`<+` | _Infix_ | _Append_ | _list_ `<+` _any_ -> _list_
|
||||
.3+|*ASSIGN*| [blue]`=` | _Infix_ | _Assignment_ | _identifier_ `=` _any_ -> _any_
|
||||
| [blue]`>>` | _Infix_ | _Front-insert_ | _any_ `>>` _list_ -> _list_
|
||||
| [blue]`<<` | _Infix_ | _Back-insert_ | _list_ `<<` _any_ -> _list_
|
||||
.2+|*ASSIGN*| [blue]`=` | _Infix_ | _Assignment_ | _identifier_ `=` _any_ -> _any_
|
||||
4+| _See also the special assignment operators table below_
|
||||
.1+|*BUT*| [blue]`but` | _Infix_ | _But_ | _any_ `but` _any_ -> _any_
|
||||
.1+|*RANGE*| [blue]`:` | _Infix_ | _Index-range_ | _integer_ `:` _integer_ -> _integer-pair_
|
||||
|===
|
||||
|
||||
//^1^ Experimental
|
||||
|
||||
.Special assignment perators
|
||||
[cols="^2,^2,^4,^6"]
|
||||
|===
|
||||
| Priority | Operator | Operation |Equivalent operation
|
||||
|
||||
.9+|*ASSIGN*| [blue]`+=` | _Sum & Assign_ | _var_ `\+=` _expr_ +
|
||||
short for +
|
||||
_var_ `=` _value-of-var_ `+` _expr_
|
||||
| [blue]`-=` | _Subtract & Assign_ | _var_ `-=` _expr_ +
|
||||
short for +
|
||||
_var_ `=` _value-of-var_ `-` _expr_
|
||||
| [blue]`*=` | _Multiply & Assign_ | _var_ `\*=` _expr_ +
|
||||
short for +
|
||||
_var_ `=` _value-of-var_ `*` _expr_
|
||||
| [blue]`/=` | _Divide & Assign_ | _var_ `/=` _expr_ +
|
||||
short for +
|
||||
_var_ `=` _value-of-var_ `/` _expr_
|
||||
| [blue]`%=` | _Remainder & Assign_ | _var_ `%=` _expr_ +
|
||||
short for +
|
||||
_var_ `=` _value-of-var_ `%` _expr_
|
||||
| [blue]`&=` | _Bitwise and & Assign_ | _var_ `&=` _expr_ +
|
||||
short for +
|
||||
_var_ `=` _value-of-var_ `&` _expr_
|
||||
| [blue]`\|=` | _Bitwise or & Assign_ | _var_ `\|=` _expr_ +
|
||||
short for +
|
||||
_var_ `=` _value-of-var_ `\|` _expr_
|
||||
| [blue]`<\<=` | _Left shift & Assign_ | _var_ `<\<=` _expr_ +
|
||||
short for +
|
||||
_var_ `=` _value-of-var_ `<<` _expr_
|
||||
| [blue]`>>=` | _Right shift & Assign_ | _var_ `>>=` _expr_ +
|
||||
short for +
|
||||
_var_ `=` _value-of-var_ `>>` _expr_
|
||||
|===
|
||||
|
||||
== Functions
|
||||
Functions in _Expr_ are very similar to functions available in many programming languages. Currently, _Expr_ supports two types of function, _expr-functions_ and _go-functions_.
|
||||
@@ -844,7 +878,7 @@ _param-name_ = _identifier_
|
||||
|
||||
|
||||
=== _Golang_ function definition
|
||||
Description of how to define Golan functions and how to bind them to _Expr_ are topics treated in another document that I'll write, one day, maybe.
|
||||
Description of how to define Golang functions and how to bind them to _Expr_ are topics covered in another document that I'll write, one day, maybe.
|
||||
|
||||
=== Function calls
|
||||
To call a function, either Expr or Golang type, it is necessary to specify its name and, at least, its required parameters.
|
||||
|
||||
Reference in New Issue
Block a user