[previous] [up] [next]     [contents] [index]
Next: Procedures Up: Scheme Namespaces (Top-Level Environments) Previous: Scheme Namespaces (Top-Level 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 namespace env, where name is a null-terminated string. (The string's case will be normalized in the same way as for interning a symbol.)

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

Adds a value to the table of globals by symbol name instead of string 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 built-in 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 namespace 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. Both are undefined despite their potential 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 namespace env.

void scheme_set_keyword(Scheme_Object *sym, Scheme_Env *env) 

Declares the given symbol to be a keyword in the namespace 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_global_bucket(char *procname, Scheme_Bucket *var, Scheme_Object *val, 
     int set_undef) 

Changes the value of a global variable. The procname argument is used to report errors (in case the global variable is constant, not yet bound, or a keyword). If set_undef is not 1, then the global variable must already have a binding. (For example, set! cannot set unbound variables, while define can.)

Scheme_Env *scheme_get_env(Scheme_Config *config) 

Returns the current namespace for the given parameterization. See section 3.8 for more information. The current thread's current parameterization is available as scheme_config.


[previous] [up] [next]     [contents] [index]
Next: Procedures Up: Scheme Namespaces (Top-Level Environments) Previous: Scheme Namespaces (Top-Level Environments)

PLT