sys.call(which=<>) sys.frame(which=< >) sys.nframe() sys.function(n=< >) sys.parent(n=1) sys.calls() sys.frames() sys.parents() sys.on.exit()
which
| the frame number. |
n
| the number of frame generations to go back. |
sys.parent
does.
You also need access to the environment where a function is being evaluated
this is what sys.frame
does.
Often sys.parent
is the globalEnv
or the top-level environment.
This is given number 1 in the list of frames. Each subsequent function
evaluation increases the frame stack by 1 and the environment for evaluation
of that function is returned by sys.frame
with the appropriate index.
sys.call
and sys.frame
both accept either positive or negative
values for the argument which
. Positive values of which
count up
from frame 1 and negative values are count back from frame n.
Notice that even though the sys.xxx
functions are interpreted their
contexts are not counted nor are they reported. There is no access to
them.
sys.status
has not been implemented yet.