Scheme_Env * scheme_new_frame(int n, int flags)
Creates a new run-time environment frame with n slots. Currently, flags should always be 0. This frame can be used to extend the environment with (only one) scheme_extend_env.
Scheme_Env * scheme_new_compilation_frame(int n)
Creates a new compile- or expand-time environment frame with n slots. This frame can be used to extend the environment with (only one) scheme_extend_env.
Scheme_Env * scheme_extend_env(Scheme_Env *frame, Scheme_Env *env)
Creates a new (compile-time or run-time) environment by extending env with frame. WARNING: This is a macro -- frame is evaluated more than once!
void scheme_add_binding(int index, Scheme_Object *val, Scheme_Env *frame)
Sets the indexth value in frame to val.
void scheme_add_compilation_binding(int index, Scheme_Object *sym,
Scheme_Env *frame)
Sets the indexth variable name in frame to val.
void scheme_get_binding(Scheme_Env *frame, Scheme_Object *val)
Gets the indexth value/name from frame.
Scheme_Env * scheme_add_frame(Scheme_Object *vals, Scheme_Env *env, int flags)
Extends the run-time environment env with a new frame; vals is a list of values to be put into the new frame. flags should be 0.
Scheme_Env * scheme_add_compilation_frame( Scheme_Object *names,
Scheme_Env *env, int flags)
Extends the compile- or expand-time environment env with a new frame; names is a list of values to be put into the new frame. Currently, flags should always be 0.
Scheme_Env * scheme_lengthen_compilation_frame( int count, Scheme_Env *frame)
Creates a new compile-time frame to replace frame (making it larger). count new slots are added to frame. The new frame is added to the rest of the environment and returned.
void scheme_frame_backinfo(Scheme_Env *orig, Scheme_Env *extended)
When scheme_lengthen_compilation_frame is used to resize a compile-time frame, after compiling all exprssions that need the extended frame, apply this function to both the extended and original frames to propogate any information that sub-compilations (using the extended frame) may have added to the environment.
Scheme_Env * scheme_next_frame(Scheme_Env *env)
Returns the frame for the static scope one level up.
int scheme_get_frame_settable(Scheme_Env *env)
Returns the flag of the given compile-time environment which indicates whether values in the frame can be changed with set!.
int scheme_settable_frame(Scheme_Env *env, int settable)
Set the flag of the given compile-time environment which indicates whether values in the frame can be changed with set!.
Scheme_Object * scheme_static_distance(Scheme_Object *sym, Scheme_Env *env,
int flags)
Given a variable name (as a symbol) in sym, returns one of:
Use SCHEME_ENV_CONSTANTS_OK if a variable's value is needed, or SCHEME_GLOB_ALWAYS_REFERENCE if a variable is being mutated. Use SCHEME_ELIM_CONST when the compilation info record's can_optimize_constants value is TRUE and a variable's value is needed.
void scheme_set_value(Scheme_Object *sd, Scheme_Object *val, Scheme_Env *env)
Given a static-distance (or scheme_variable_type) value, sets the value in the run-time environment env to val.
void scheme_check_identifier(char *form, Scheme_Object *id, char *where)
Checks that id is a valid local variable identifier symbol. If an error is found, form is used as a syntax name to report the location of the error; if where is non-NULL, it should have the form ``in ...'' to further specify the location of the error.