Metaclass for Falcon function type.
Class Function from \ BOM( )
Methods | |
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. |
stack | Gets a string representation of the call stack. |
trace | Gets a trace step in the call stack. |
Methods inherited from class BOM | |
__add | Overrides binary addition operand. |
__call | Overrides call operator "self()". |
__dec | Overrides decrement unary prefix operand. |
__decpost | Overrides decrement unary postfix operand. |
__div | Overrides binary division operand. |
__getIndex | Overrides array access operator [] |
__inc | Overrides increment unary prefix operand. |
__incpost | Overrides increment unary postifx operand. |
__mod | Overrides modulo operand. |
__mul | Overrides binary multiplication operand. |
__pow | Overrides power operand. |
__setIndex | Overrides array write operator [] |
__sub | Overrides binary subtraction operand. |
baseClass | Returns the class item from which an object has been instantiated. |
bound | Determines if an item is bound or not. |
className | Returns the name of the class an instance is instantiated from. |
clone | Performs a deep copy of the item. |
compare | Performs a lexicographical comparison. |
derivedFrom | Checks if this item has a given parent. |
describe | Returns the deep contents of an item on a string representation. |
isCallable | Determines if an item is callable. |
len | Retrieves the length of a collection |
metaclass | Returns the metaclass associated with this item. |
ptr | Returns a raw memory pointer out of this data (as an integer). |
serialize | Serialize the item on a stream for persistent storage. |
toString | Coverts the object to string. |
typeId | Returns an integer indicating the type of this item. |
Returns a dictionary containing annotation attributes of the given function.
Function.attributes()
Return | Nil if the function has no attributes, or a string-indexed dictionary. |
See also: attributes.
Gets the direct caller or one of the calling ancestors.
Function.caller( [level] )
level | Caller level (starting from zero, the default). |
Return | 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()
Return | 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 string representation of the call stack.
Function.stack()
Return | A string containing all the stack trace up to this point. |
The returned string looks like the stack trace printed by errors, but is referred to the call stack up to the function from which this method is called.
Note: The method can also be called statically on the Function metaclass.
Gets a trace step in the call stack.
Function.trace( [level] )
level | Caller level (starting from zero, the default). |
Return | 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.