Operators
Operators use the precedence from Java, with the exception of the power operator, which comes from Python.
Operators can have values on the left and/or right, which Menter indicates by an interval-syntax:
( )
round parenthesis show that there is a value on that side of the operator[ ]
square brackets show that there is no value on that side of the operator
The round parenthesis indicate where the values are that are transformed by the operator.
Examples for the -
and !
operators:
-4
[-) 4
the operator value is on the right side of the operator6 - 4
6 (-) 4
there are values on both sides of the operator
And some more examples:
!true
→[!) true
6!
→6 (!]
Find a full list of operators here.
Operator functions
Using the interval syntax above, operators can be transformed into functions that take either one or two arguments.
For example, the +
operator can be transformed into a function that takes two arguments, or the !
operator with one argument.
That way, operators can be passed as arguments to other functions.
Compound assignment operator
A special feature of Menter is, that the assignment operator can be combined with any other operator.
This is called a compound assignment operator.
A quality of life feature regarding this is, that if the assigning variable is not defined, it will be initialized with the value of the right hand side.