A Scheme program can use the make-stack
primitive anywhere in its
code, with first arg #t
, to construct a Scheme value that
describes the Scheme stack at that point.
(make-stack #t) ⇒ #<stack 805c840:808d250>
Create a new stack. If obj is
#t
, the current evaluation stack is used for creating the stack frames, otherwise the frames are taken from obj (which must be either a debug object or a continuation).args should be a list containing any combination of integer, procedure and
#t
values.These values specify various ways of cutting away uninteresting stack frames from the top and bottom of the stack that
make-stack
returns. They come in pairs like this:(
inner_cut_1 outer_cut_1 inner_cut_2 outer_cut_2...)
.Each inner_cut_N can be
#t
, an integer, or a procedure.#t
means to cut away all frames up to but excluding the first user module frame. An integer means to cut away exactly that number of frames. A procedure means to cut away all frames up to but excluding the application frame whose procedure matches the specified one.Each outer_cut_N can be an integer or a procedure. An integer means to cut away that number of frames. A procedure means to cut away frames down to but excluding the application frame whose procedure matches the specified one.
If the outer_cut_N of the last pair is missing, it is taken as 0.