Werecat Expressions

Werecat supports the following syntax in expressions.

OperatorDescription
!xBoolean not
+x, -xNumerical +/-
a*b, a/b, a%bMultiply, divide, integer mod
a+b, a-bNumeric add, substract
a<b, a <= b, a > b, a >= bNumeric comparison
a=b, a == b, a != bEquality checks (numeric if possible, string otherwise)
a =~ bb must be a regexpr of form /pattern/. Evaluates to index of first match, or false
a !~ bb must be a regexpr of form /pattern/. True if a does not match b
a && b, a and bBoolean and
a || b, a or bBoolean or
a.identifierField deference
a[b]Array index, Map lookup, or Set contains. B must be a valid type for the operation.
a(b,c,...)Function calls, method must be public.

Werecat supports the following literals.

LiteralExamples
Numbers1, 3, .02, 0.2
Characters'a'
Strings"foo"
Regexp/pattern/
Constantstrue, false, null

[Back to Werecat Home]