Constants are immutable values. Constants are defined with keyword
const. Expression, used for constants definition should not contain variables or function calls. Also there is no need to specify type of constant.
const <name> := <value>;
const a := 8; const s := "hello";
Structural constants can be defined as well as atomic. te supports defining constant lists, structures, sets or even functions. For better understanding see sections list constant and struct constant
Variables unlike constants can be reassigned during program execution. Also variable definition requires type to be specified explicitly.
var <name>: <type> := <initial value>;
Initial value is not required, but in case of use it must be immutable, i.e.В you can not use another variables or call functions to define variable initial value. All variables without initial values are initialized with their default values. Jarog doesnвЂ™t contain value like
null or other empty equivalent. Instead each type has itвЂ™s own default value. See the table below.
Structures are initialized accordingly to their field types, lists are initialized as empty list. Sets are also initialized as empty set. Functions are initialized with a special empty function. It accepts parameters, specified in function type and does nothing but returns result, initialized with default value.
Multiple variable definition
It is possible to declare more than one variable of the same type at once.
var <name1>, <name2>: <type>;
In case of using initial values, they are assigned to variables respectively. Amount of initial values should be the same as amount of variables.
var <name1>, <name2>: <type> := <value1>, <value2>;
It is equal to next definition:
var <name1>: <type> := <value1>; var <name2>: <type> := <value2>;