forester
forester copied to clipboard
Allow operations in arguments
Provide the operations with arguments "on the fly":
impl act(a:num, b:bool);
root main sequence {
act(a = a + 1, b = b1 || b2 && !b3)
}
Arithmetic
Rules:
- only numerical types or the node gets failed
- different types get cast to the next type (int -> float) but binary and hex don't
- when it is impossible the node gets failed
- for division can be an exception also with 0
- parentheses
Operations:
- addition (+)
- obstruction (-)
- multiplication (*)
- division (/)
- the remainder (%)
Logical
Rules:
- only boolean types or the node gets failed
Operations:
- logical and (&&)
- logical or (||)
- logical not (!)
- parentheses
Comparison
Rules:
- the type should be the same
- the gr,ls etc only for numeric types
- parentheses
Operations:
- Equal (==)
- Greater (>)
- Greater or Equal (>=)
- Less(<)
- Less or Eq (<=)
- not Equal (!=)