The Expression Evaluator Object's Built-in Operators
Arithmetic Operators
Relaional Operators
Logical Operators
Bitwise Operators
Other Operators
Assigment Operators
Format:
Name
param1 operator param2
Precedence:
Number,Number: what function does with numeric parameters
String,String: what function does with string parameters
List,List: what function does with List parameters
Note: If a particualr combination is left out, the operator does not support it and will generate an error.
Division
param1 / param2
Precedence: 4
Number,Number: returns the quotient of two numbers (uses
integer division if both parameters are integers)
Number,List: returns a list containing the number / list_element
List,Number: returns a list containing the list_element
/ number
Modulus
param1 % param2
Precedence: 4
Number,Number: returns the remainder of the quotient of
two the two numbers (uses integer modulus if both parameters are
integers)
Number,List: returns a list containing the number % list_element
List,Number: returns a list containing the list_element
% number
Multiplication
param1 * param2
param1 (param2)
(param1) param2
(param1)(param2)
Precedence: 4
Number,Number: returns the product two numbers
Number,List: returns a list containing the number * list_element
List,Number: returns a list containing the list_element
* number
Addition
param1 + param2
Precedence: 5
Number,Number: returns the sum of two numbers
String,String: concatenates the two strings
Number,String: treats the number as a string and concatenates the
strings
String,Number: treats the number as a string and concatenates the
strings
Number,List: returns a list containing the number + list_element
String,List: returns a list containing the string + list_element
List,Number: returns a list containing the list_element
+ number
List,String: returns a list containing the list_element
+ string
List,List: concatenates the two lists
Subtraction
param1 - param2
Precedence: 5
Number,Number: returns the difference between two numbers
Number,List: returns a list containing the number - list_element
List,Number: returns a list containing the list_element
- number
Contains
param1 =~ param2
Precedence: 3
Number,Number: treats the numbers as strings and returns
true if param1 contains param2
String,String: returns true if param1 contains param2
Number,String: treats the number as a string and returns true if param1
contains param2
String,Number: treats the number as a string and returns true if param1
contains param2
Number,List: returns a list containing the number =~ list_element
String,List: returns a list containing the string =~ list_element
List,Number: returns a list containing the list_element
=~ number
List,String: returns a list containing the list_element
=~ string
Equal To
param1 == param2
Precedence: 8
Number,Number: returns true if the two numbers are
equivalent
String,String: returns true if the two strings are the same
Number,String: treats the number as a string and returns true if
the two strings are the same
String,Number: treats the number as a string and returns true if
the two strings are the same
Number,List: returns a list containing the number == list_element
String,List: returns a list containing the string == list_element
List,Number: returns a list containing the list_element
== number
List,String: returns a list containing the list_element
== string
Less Than
param1 < param2
Precedence: 7
Number,Number: returns true if param1 is less
than param2
String,String: returns true if if param1 is less than param2
Number,String: treats the number as a string and returns true if param1
is less than param2
String,Number: treats the number as a string and returns true if param1
is less than param2
Number,List: returns a list containing the number < list_element
String,List: returns a list containing the string < list_element
List,Number: returns a list containing the list_element
< number
List,String: returns a list containing the list_element
< string
Less Than or Equal To
param1 <= param2
Precedence: 7
Number,Number: returns true if param1 is less
than or equal to param2
String,String: returns true if if param1 is less than or
equal to param2
Number,String: treats the number as a string and returns true if param1
is less than or equal to param2
String,Number: treats the number as a string and returns true if param1
is less than or equal to param2
Number,List: returns a list containing the number <= list_element
String,List: returns a list containing the string <= list_element
List,Number: returns a list containing the list_element
<= number
List,String: returns a list containing the list_element
<= string
Greater Than
param1 > param2
Precedence: 7
Number,Number: returns true if param1 is greater
than param2
String,String: returns true if if param1 is greater than
param2
Number,String: treats the number as a string and returns true if param1
is greater than param2
String,Number: treats the number as a string and returns true if param1
is greater than param2
Number,List: returns a list containing the number > list_element
String,List: returns a list containing the string > list_element
List,Number: returns a list containing the list_element
> number
List,String: returns a list containing the list_element
> string
Greater Than or Equal To
param1 <= param2
Precedence: 7
Number,Number: returns true if param1 is greater
than or equal to param2
String,String: returns true if if param1 is greater than
or equal to param2
Number,String: treats the number as a string and returns true if param1
is greater than or equal to param2
String,Number: treats the number as a string and returns true if param1
is greater than or equal to param2
Number,List: returns a list containing the number >= list_element
String,List: returns a list containing the string >= list_element
List,Number: returns a list containing the list_element
>= number
List,String: returns a list containing the list_element
>= string
Not Contains
param1 !~ param2
Precedence: 3
Number,Number: treats the numbers as strings and returns
true if param1 does not contain param2
String,String: returns true if param1 does not contain param2
Number,String: treats the number as a string and returns true if param1
does not contain param2
String,Number: treats the number as a string and returns true if param1
does not contain param2
Number,List: returns a list containing the number !~ list_element
String,List: returns a list containing the string !~ list_element
List,Number: returns a list containing the list_element
!~ number
List,String: returns a list containing the list_element
!~ string
Not Equal To
param1 != param2
Precedence: 8
Number,Number: returns true if the two numbers are not
equivalent
String,String: returns true if the two strings are not the same
Number,String: treats the number as a string and returns true if
the two strings are not the same
String,Number: treats the number as a string and returns true if
the two strings are not the same
Number,List: returns a list containing the number != list_element
String,List: returns a list containing the string != list_element
List,Number: returns a list containing the list_element
!= number
List,String: returns a list containing the list_element
!= string
Logical And
param1 && param2
Precedence: 12
Number,Number: returns true if both param1 and param2
are non-zero
Number,List: returns a list containing the number &&
list_element
List,Number: returns a list containing the list_element
&& number
Logical Or
param1 || param2
Precedence: 13
Number,Number: returns true if either param1 or param2
is non-zero
Number,List: returns a list containing the number || list_element
List,Number: returns a list containing the list_element
|| number
Bitwise And
param1 & param2
Precedence: 9
Number,Number: rounds the parameters to integers and
retruns the number resulting from performing logical and comparisons
on the bits in each number
Number,List: returns a list containing the number & list_element
List,Number: returns a list containing the list_element
& number
Bitwise Or
param1 | param2
Precedence: 11
Number,Number: rounds the parameters to integers and
retruns the number resulting from performing logical or comparisons
on the bits in each number
Number,List: returns a list containing the number | list_element
List,Number: returns a list containing the list_element
| number
Bitwise Xor
param1 & param2
Precedence: 10
Number,Number: rounds the parameters to integers and
retruns the number resulting from performing logical
exclusive or comparisons on the bits in each number
Number,List: returns a list containing the number ^ list_element
List,Number: returns a list containing the list_element
^ number
Concatenation
param1 . param2
Precedence: 5
Number,Number: concatenates the numbers (for example, (4).(5)
becomes 45). If both numbers contain a decimal, the second
number's decimal will be stripped. If the first number has an
exponent, it will be stripped.
String,String: concatenates the two strings
Number,String: treats the number as a string and concatenates the
strings
String,Number: treats the number as a string and concatenates the
strings
Number,List: returns a list containing the number . list_element
String,List: returns a list containing the string . list_element
List,Number: returns a list containing the list_element
. number
List,String: returns a list containing the list_element
. string
List,List: concatenates the two lists
Multiple Expression Operator
param1 ; param2
Precedence: 50
Expression, Expression: evaluates the two expressions from left
to right and returns the result of the second parameter
Addition Assignment
variable += param
Precedence: 15
Variable,Anything: Stores variable_value + param
into the variable named variable and returns that value
Assignment
variable = param
Precedence: 15
Variable,Anything: Stores param into the variable
named variable and returns that value. This operator
will check global variables first. If variable does not
exist, it is created. It will be created as a local variable if
possible.
Bitwise And Assignment
variable &= param
Precedence: 15
Variable,Anything: Stores variable_value & param
into the variable named variable and returns that value
Bitwise Or Assignment
variable |= param
Precedence: 15
Variable,Anything: Stores variable_value | param
into the variable named variable and returns that value
Bitwise Xor Assignment
variable ^= param
Precedence: 15
Variable,Anything: Stores variable_value ^ param
into the variable named variable and returns that value
Concatenation Assignment
variable .= param
Precedence: 15
Variable,Anything: Stores variable_value . param
into the variable named variable and returns that value
Definition
variable := param
Precedence: 15
Variable,Anything: Stores param into the variable
named variable and returns that value. This operator
will only check local variables first unless there are no local
variables. If variable does not exist, it is created. It
will be created as a local variable if possible.
Division Assignment
variable /= param
Precedence: 15
Variable,Anything: Stores variable_value / param
into the variable named variable and returns that value
Modulus Assignment
variable %= param
Precedence: 15
Variable,Anything: Stores variable_value % param
into the variable named variable and returns that value
Multiplication Assignment
variable *= param
Precedence: 15
Variable,Anything: Stores variable_value * param
into the variable named variable and returns that value
Subtraction Assignment
variable -= param
Precedence: 15
Variable,Anything: Stores variable_value - param
into the variable named variable and returns that value