Vikari Language Documentation


Available since:  v0.1.1.

Grouping Expressions

Grouping expressions group other sub-expressions using [ and ] like other languages typically use parentheses. This allows for example arithmetic expressions to specify order of operations beyond the standard execution order of operators.

Operator NameSymbolFunction
Left Square Bracket[Begin a grouping expression.
Left Square Bracket]End a grouping expression.

Examples

Any expression can be grouped together using [ and ]. For example, arithmetic expressions can be grouped together for complete clarity in order of operations.

~:Grouping arithmetic in an assignment expression.:~
foo << [2.7 + 5.2]
bar << 9.4 / [3.2 - 6.1]

Or more complex expressions can be grouped together to ensure a proper order or execution of each part of the overall expression, such as with logical and comparison operators.

~:Nested groupings with logical operators in a print statement.:~
:[[foo = 5] ^ [bar '= 7]]: