previous up next     contents index
Next: Library Functions Up: MzScheme Architecture Previous: Library Functions

Scheme Environments

  A Scheme environment is represented by a structure of type  Scheme_Env. Calling  scheme_basic_env returns an environment that includes all of the standard Scheme global functions and syntax.

  scheme_basic_env should only be called once by an embedding program, before any other MzScheme functions are called. The environment that is returned is also the global environment for the main MzScheme thread. MzScheme extensions cannot call scheme_basic_env.

The scheme functions  load and  eval always use the current global environment. New primitive procedures must follow this convention. For more information on threads and their environments, see section 3.7.

  New values can be added as globals in an evironment using  scheme_add_global. The  scheme_lookup_global function takes a Scheme symbol and returns the global value for that name, or NULL if the symbol is undefined.

  Environments are only read directly or extended by new primitive syntax (see section 3.15). More environment routines are defined there (section 3.16).





PLT