Skip to content

Features Operators

Kameron Brooks edited this page Aug 17, 2019 · 1 revision

Operators

Most of the supported operators should be familiar, as they are the same as most popular languages

Unary

-x Numeric Negate

!x Boolean Negate (Not)

x++ Post Increment

x-- Post Decrement

(pre increment operators not supported)

++x // Not supported
--x // Not supported

Arithmetic

x + y Addition

x - y Subtraction

x * y Multiplication

x / y Division

x ** y Exponent (x to the y power)

x % y Modulo (the remainder of x / y)


Logic

x && y And

x || y Or


Bitwise

x & y Bitwise And

x | y Bitwise Or

x ^ y Bitwise XOr


Comparison

x == y Equals

x != y Not Equals

x > y Greater Than

x < y Less Than

x >= y Greater Than or Equal To

x <= y Less Than or Equal To


Assignment

x = y Assign

x += y Increment and Assign (x = x + y)

x -= y Decrement and Assign (x = x - y)

x *= y Multiply and Assign (x = x * y)

x /= y Divide and Assign (x = x / y)


Arrays

x[y] Array Access

x :: arr In-Set (return true if array contains element) New*

x !:: arr Not-In-Set (return false if array contains element) New*

x..y Interp (create an inclusive list of integers from x to y) New*


Member Access

y.x Member Access

(access the property or method 'x' on object 'y')

y?.x Null Conditional Member Access Not Supported Yet

access the property or method 'x' on object 'y' if x exists and is not null. If conditions are not met, the statement is aborted without throwing an exception.