Vikari Language Documentation


Available since:  v0.1.1.

Expression Statements

All expressions in Vikari can be executed as a separate statement. Expressions with no side effects will have no impact on the running program. The primary example of an expression statement with side effects is an assignment expression assigning to a variable that has already been declared. But arbitrary expressions are still valid Vikari statements.

Examples

The following demonstrates expression statements with side effects.

~:First, declare some variables.:~
foo
bar:Integer
baz:Boolean

~:Use the assignment operator to write expression statements.:~
foo << 2
bar << 5 + 7
[foo '= bar] >> baz

The following demonstrates expression statements without side effects.

~:These expression statements have no side effects.:~
5 + 2
[foo = 2] ^ [bar '= false]