6.26.1.3 Frames

Scheme Procedure: frame? obj
C Function: scm_frame_p (obj)

Return #t if obj is a stack frame.

Scheme Procedure: frame-previous frame
C Function: scm_frame_previous (frame)

Return the previous frame of frame, or #f if frame is the first frame in its stack.

Scheme Procedure: frame-procedure-name frame
C Function: scm_frame_procedure_name (frame)

Return the name of the procedure being applied in frame, as a symbol, or #f if the procedure has no name.

Scheme Procedure: frame-arguments frame
C Function: scm_frame_arguments (frame)

Return the arguments of frame.

Scheme Procedure: frame-address frame
Scheme Procedure: frame-instruction-pointer frame
Scheme Procedure: frame-stack-pointer frame

Accessors for the three VM registers associated with this frame: the frame pointer (fp), instruction pointer (ip), and stack pointer (sp), respectively. See VM Concepts, for more information.

Scheme Procedure: frame-return-address frame
Scheme Procedure: frame-mv-return-address frame

Accessors for the three saved VM registers in a frame: the previous frame pointer, the single-value return address, and the multiple-value return address. See Stack Layout, for more information.

Scheme Procedure: frame-bindings frame

Return a list of binding records indicating the local variables that are live in a frame.

Scheme Procedure: frame-lookup-binding frame var

Fetch the bindings in frame, and return the first one whose name is var, or #f otherwise.

Scheme Procedure: binding-index binding
Scheme Procedure: binding-name binding
Scheme Procedure: binding-slot binding
Scheme Procedure: binding-representation binding

Accessors for the various fields in a binding. The implicit “callee” argument is index 0, the first argument is index 1, and so on to the end of the arguments. After that are temporary variables. Note that if a variable is dead, it might not be available.

Scheme Procedure: binding-ref binding
Scheme Procedure: binding-set! binding val

Accessors for the values of local variables in a frame.

Scheme Procedure: display-application frame [port [indent]]
C Function: scm_display_application (frame, port, indent)

Display a procedure application frame to the output port port. indent specifies the indentation of the output.

Additionally, the (system vm frame) module defines a number of higher-level introspective procedures, for example to retrieve the names of local variables, and the source location to correspond to a frame. See its source code for more details.