Package tp :: Package client :: Package pyscheme :: Module environment
[show private | hide private]
[frames | no frames]

Module tp.client.pyscheme.environment

Environment stuff.  Exercise 4.11 asks us to develop an alternative
environment implementation.  This is an implementation of environments
that uses a chained list of Python dictionaries.

Function Summary
  addBindingToFrame(var, val, frame)
  defineVariable(var, val, env)
  enclosingEnvironment(env)
  extendEnvironment(var_pairs, val_pairs, base_env)
Extends an environment with a new set of bindings.
  firstFrame(env)
  lookupVariableValue(var, env)
  makeFrame(var_pairs, val_pairs)
Note: here I diverge from SICP's implementation: instead of using a cons, I use a Python list.
  setVariableValue(var, val, env)

Variable Summary
str __license__ = 'MIT License'
list THE_EMPTY_ENVIRONMENT = []

Function Details

extendEnvironment(var_pairs, val_pairs, base_env)

Extends an environment with a new set of bindings.  Extended to
support Scheme's dotted notation for varargs.

makeFrame(var_pairs, val_pairs)

Note: here I diverge from SICP's implementation: instead of
using a cons, I use a Python list.  The selectors frameVariables()
and frameValues() reflect this.

Variable Details

__license__

Type:
str
Value:
'MIT License'                                                          

THE_EMPTY_ENVIRONMENT

Type:
list
Value:
[]                                                                     

Generated by Epydoc 2.1 on Fri Jan 1 08:00:27 2010 http://epydoc.sf.net