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

Module tp.client.pyscheme.evaluator

A evaluator based on CPS form and trampolining.



FIXME: add a lot more documentation here about how this all works.


The core forms that the evaluator recognizes is the following:

    self evaluating expressions
    variable references
    QUOTE
    SET!
    DEFINE
    IF
    LAMBDA
    BEGIN
    function application

Other special forms are handled by derivation: the expander module translates
the derived forms into these core forms.

FIXME: quasiquotation hasn't been pushed off into the expander yet.

Function Summary
  apply(procedure, arguments, env, cont)
Applies a procedure on a list of arguments.
  applyContinuationProcedure(proc, args)
  applyPrimitiveProcedure(proc, args, env, cont)
  eval(exp, env)
  evalApplication(exp, env, cont)
  evalAssignment(exp, env, cont)
  evalDefinition(exp, env, cont)
  evalIf(exp, env, cont)
  evalQuoted(exp, env, cont)
Returns a quoted expression, using deepQuotedEval to look for UNQUOTE.
  evalRands(exps, env, cont)
Given a list of expressions, returns a new list containing the values of evaluating each on of them.
  evalSequence(exps, env, cont)
  identity(val)
The identity function.
  teval(exp, env, cont)
Evaluates an expression 'exp' in an environment 'env'.

Variable Summary
str __license__ = 'MIT License'

Function Details

apply(procedure, arguments, env, cont)

Applies a procedure on a list of arguments.

evalQuoted(exp, env, cont)

Returns a quoted expression, using deepQuotedEval to look for
UNQUOTE.

Consequently, quoted elements are properly turned into cons pairs.

evalRands(exps, env, cont)

Given a list of expressions, returns a new list containing the
values of evaluating each on of them.  If the continuation is
given, then calls cont() on the evaluated operands instead.

identity(val)

The identity function.

teval(exp, env, cont)

Evaluates an expression 'exp' in an environment 'env'.

Exercise 4.3 asks us to rewrite this in a more natural
data-directed manner.  Pychecker, also, doesn't like seeing
so many 'return' statements in one function.  *grin*

Variable Details

__license__

Type:
str
Value:
'MIT License'                                                          

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