getCallingFunction
getCallingFunction( [tx_nestingLevel] ) =>s_functionName/ nil
Description
Returns the name of the calling function or procedure at the specified level in the call stack.
Arguments
|
Indicates the nesting level of the procedure of function name to be returned. If not specified, the name of the current function is returned. |
Value Returned
|
If the specified level exceeds the call stack level, or the function at the specified level is unnamed, |
Examples
The following returns the name of the function one level up in the nest of calls. This is the same as getCallingFunction(1)
getCallingFunction()
The following returns the name of the current function.
getCallingFunction(0)
The following returns the name of the function one level up in the nest.
The following returns the name of the function n levels up in the nest, or the top level function if n-1 is the top, or nil.
getCallingFunction(n)
The following example returns the names of the functions in a list.
(defun Child () (list (getCallingFunction 3)
(getCallingFunction 2)
(getCallingFunction 1)
(getCallingFunction)))
(defun Parent() (Child))
(defun GrandParent()(Parent))
(defun GreatGrandParent() (GrandParent))
(GreatGrandParent)
=> (GreatGrandParent GrandParent Parent Child)
Related Topics
Return to top