SYNOPSIS

object * caller_stack()
object * caller_stack( int add_interactive)

DESCRIPTION

Returns an array of the previous objects who caused the call_other(E) to this_object(E). previous_object(i) equals caller_stack()[i].

If you pass the optional argument add_interactive (as true value) this_interactive() is appended to the array, or 0 if there is no current interactive.

Note

calls to ‘alien lfun closures’ (see symbol_function(E)) generate two entries on the stack if the bound object differs from the closure object: the first is for the bound object, the second for the closure object.

USAGE

interactive object A enters a command which causes a call to a function in object B, that one calls a function in object C and that, in turn, in object D

If D now calls caller_stack() the result would be: ({C,B}). If it calls caller_stack(1) the result is: ({C,B,A}).

HISTORY

  • introduced (3.2.6) – suggested by Tubmud.