previous up next     contents index
Next: Procedures Up: Scheme Environments Previous: Scheme Environments

Library Functions

 
void   scheme_add_global(char *name, Scheme_Object *val, Scheme_Env *env) 

Adds a value to the table of globals for the environment env.

 
void   scheme_add_global_symbol(Scheme_Object *name, Scheme_Object *val, Scheme_Env *env) 

Adds a value to the table of globals by symbol instead of name.

 
void   scheme_add_global_constant(char *name, Scheme_Object *v, Scheme_Env *env) 

Like scheme_add_global, but the global variable name is also made constant if builtin-constants are enabled, and #%name is also defined as a constant.

 
void   scheme_add_global_keyword(char *name, Scheme_Object *v, Scheme_Env *env) 

Like scheme_add_global, but the global variable name is also made constant and a keyword (unless keywords are disabled).

 
void   scheme_remove_global(char *name, Scheme_Env *env) 

Removes the variable binding from the table of globals for the environment env. Constant globals cannot be removed.

 
void   scheme_remove_global_symbol(Scheme_Object *name, Scheme_Env *env) 

Removes a variable binding from the table of globals by symbol instead of by name.

 
void   scheme_remove_global_constant(char *name, Scheme_Env *env) 

Undefines name and also #%name. The latter is undefined despite its constantness.

 
void   scheme_constant(Scheme_Object *sym, Scheme_Env *env) 

Declares the given global variable name (given as a symbol) to be constant in the table of globals for the environment env.

 
void   scheme_set_keyword(Scheme_Object *sym, Scheme_Env *env) 

Declares the given symbol to be a keyword in the environment env.

 
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 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 static-distance coordinates for the symbol in the compile-time environemnt env.

If sym refers to a global, then a  scheme_variable_type value may be returned instead. If flags includes  SCHEME_ELIM_CONST, then global constants will be resolved immediately to final values, instead of a scheme_variable_type values.

 
Scheme_Object *  scheme_lookup_value(Scheme_Object *sd, Scheme_Env *env) 

Given static-distance coordinates in sd, finds the value in the run-time environment env.

 
Scheme_Object *  scheme_lookup_global(Scheme_Object *symbol, Scheme_Env *env) 

Given a global variable name (as a symbol) in sym, returns the current value.

 
Scheme_Bucket *  scheme_global_bucket( Scheme_Object *symbol, Scheme_Env *env) 

Given a global variable name (as a symbol) in sym, returns the bucket where the value is stored. When the value in this bucket is NULL, then the global variable is undefined.

The  Scheme_Bucket structure is defined as:

  typedef struct Scheme_Bucket {
    Scheme_Type type; /* = scheme_variable_type */
    void *key;
    void *val;
  } Scheme_Bucket;

 
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.

 
Scheme_Config *  scheme_env_config(Scheme_Env *env) 

Returns the configuration record for the given environment. See section 3.10.1 for more information.


previous up next     contents index
Next: Procedures Up: Scheme Environments Previous: Scheme Environments

PLT