Metaclass for Falcon function type.
class Function \ from BOM
attributes() | Returns a dictionary containing annotation attributes of the given function. |
caller() | Gets the direct caller or one of the calling ancestors. |
name() | Gets the symbolic name of the given function. |
trace() | Gets a trace step in the call stack. |
__add from BOM | Overrides binary addition operand. |
__call from BOM | Overrides call operator "self()". |
__dec from BOM | Overrides decrement unary prefix operand. |
__decpost from BOM | Overrides decrement unary postfix operand. |
__div from BOM | Overrides binary division operand. |
__getIndex from BOM | Overrides array access operator [] |
__inc from BOM | Overrides increment unary prefix operand. |
__incpost from BOM | Overrides increment unary postifx operand. |
__mod from BOM | Overrides modulo operand. |
__mul from BOM | Overrides binary multiplication operand. |
__pow from BOM | Overrides power operand. |
__setIndex from BOM | Overrides array write operator [] |
__sub from BOM | Overrides binary subtraction operand. |
baseClass from BOM | Returns the class item from which an object has been instantiated. |
bound from BOM | Determines if an item is bound or not. |
className from BOM | Returns the name of the class an instance is instantiated from. |
clone from BOM | Performs a deep copy of the item. |
compare from BOM | Performs a lexicographical comparison. |
derivedFrom from BOM | Checks if this item has a given parent. |
describe from BOM | Returns the deep contents of an item on a string representation. |
isCallable from BOM | Determines if an item is callable. |
len from BOM | Retrieves the length of a collection |
metaclass from BOM | Returns the metaclass associated with this item. |
ptr from BOM | Returns a raw memory pointer out of this data (as an integer). |
serialize from BOM | Serialize the item on a stream for persistent storage. |
toString from BOM | Coverts the object to string. |
typeId from BOM | Returns an integer indicating the type of this item. |
Returns a dictionary containing annotation attributes of the given function.
Function.attributes( )
Returns: | Nil if the function has no attributes, or a string-indexed dictionary. |
Gets the direct caller or one of the calling ancestors.
Function.caller( [level] )
level | Caller level (starting from zero, the default). |
Returns: | The item having performed the nth call. |
This function returns the n-th caller (zero based) that caused this function to be called. It may be a function, a method or another callable item from which the call has originated.
Note: The method can also be called statically on the Function metaclass.
Gets the symbolic name of the given function.
Function.name( )
Returns: | A string containing the function name |
This is useful if the function symbol or has been re-assigned to temporary variables, or if it is applied to the fself keyword.
Gets a trace step in the call stack.
Function.trace( [level] )
level | Caller level (starting from zero, the default). |
Returns: | An array containing the data relative to the given trace level. |
The returned data is organized as follows:
[ 'symbol name', 'module name', 'module path', line_in_module, PC_in_vm]
Note: The method can also be called statically on the Function metaclass.