Adds two items along the rules of VM '+' operator.
add( a, b )
a | First operand |
b | Second operand |
Return | The result of the sum. |
This function operates also on strings, arrays and dictionaries replicating the behavior of the "+" operator as it is performed by the VM.
Passe-par-tout accessor function.
at( item, access, [value] )
item | An array, string, or any accessible item or collection. | ||
access | A number, a range or a string to access the item. | ||
value | If given, will substitue the given item or range (new value). | ||
Raise |
|
This function emulates all the language-level accessors provided by Falcon. Subscript accessors ([]) accepting numbers, ranges and generic items (for dictionaries) and property accessors (.) accepting strings are fully supported. When two parameters are passed, the function works in access semantics, while when the value parameter is also given, the function will work as an accessor/subscript assignment. In example, to change a string the at function can be used as a range accessor:
string = "hello" string[0:1] = "H" //first letter up at( string, [1:], "ELLO" ) // ...all up > string > "First letter: ", at( string, 0 ) // ^^^ same as string[0]
This function is also able to access and modify the bindings of arrays (i.e. like accessing the arrays using the "." operator), members of objects and instances and static methods of classes. Properties and bindings can be accessed by names as strings. In example:
// making a binding // ... equivalent to "array.bind = ..." array = [] at( array, "bind", "binding value" ) > array.bind //... accessing a property at( CurrentTime(), "toRFC2822" )()
Trying to access an item with an incompatible type of accessor (i.e. trying to access an object with a range, or a string with a string).
Note: At the moment, the at function doesn't support BOM methods.
Performs a deep equality check.
deq( a, b )
a | First operand |
b | Second operand |
Return | true if the two items are deeply equal (same content). |
Divides two numeric operands along the rules of VM '/' operator.
div( a, b )
a | First operand |
b | Second operand |
Return | The result of the division. |
Performs a lexicographic check for the first operand being equal to the second.
equal( a, b )
a | First operand |
b | Second operand |
Return | true if a == b, false otherwise. |
Performs a lexicographic check for the first operand being greater or equal to the second.
ge( a, b )
a | First operand |
b | Second operand |
Return | true if a >= b, false otherwise. |
Performs a lexicographic check for the first operand being greater than the second.
gt( a, b )
a | First operand |
b | Second operand |
Return | true if a > b, false otherwise. |
Performs a lexicographic check for the first operand being less or equal to the second.
le( a, b )
a | First operand |
b | Second operand |
Return | true if a <= b, false otherwise. |
Performs a lexicographic check for the first operand being less than the second.
lt( a, b )
a | First operand |
b | Second operand |
Return | true if a < b, false otherwise. |
Performs a modulo division on numeric operands along the rules of VM '%' operator.
mod( a, b )
a | First operand |
b | Second operand |
Return | The result of the modulo. |
Multiplies two items along the rules of VM '*' operator.
mul( a, b )
a | First operand |
b | Second operand |
Return | The result of the multiplication. |
This function operates also on strings, arrays and dictionaries replicating the behavior of the "*" operator as it is performed by the VM.
Performs a lexicographic check for the first operand being not equal to the second.
neq( a, b )
a | First operand |
b | Second operand |
Return | true if a == b, false otherwise. |
Subtracts two items along the rules of VM '-' operator.
sub( a, b )
a | First operand |
b | Second operand |
Return | The result of the subtraction. |
This function operates also on strings, arrays and dictionaries replicating the behavior of the "-" operator as it is performed by the VM.