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

Module tp.client.pyscheme.expressions

Provides functions to extract portions of the expression tree and
to construct new expressions.  Heavily used in eval.py

Classes
ExpressionTests  

Function Summary
  assignmentValue(exp)
  assignmentVariable(exp)
  beginActions(exp)
  condActions(clause)
  condClauses(exp)
  condPredicate(clause)
  condToIf(exp)
  continuationImplementation(proc)
  definitionValue(exp)
  definitionVariable(exp)
  expandClauses(clauses)
  expandQuasiquotation(exp, depth)
Takes a quasiquoted expression and constructs a new quoted expression.
  firstExp(seq)
  firstOperand(ops)
  ifAlternative(exp)
  ifConsequent(exp)
  ifPredicate(exp)
  isApplication(exp)
  isAssignment(exp)
Assignments have the form (set! <var> <value>).
  isBegin(exp)
  isCompoundProcedure(p)
  isCond(exp)
  isCondElseClause(clause)
  isContinuationProcedure(proc)
  isDefinition(exp)
  isFalse(x)
  isIf(exp)
  isLambda(exp)
  isLastExp(seq)
  isLet(exp)
  isNoOperands(ops)
  isNumber(x)
Returns True if we see a number.
  isPrimitiveProcedure(proc)
  isQuasiquoted(exp)
  isQuoted(exp)
  isSelfEvaluating(exp)
Returns True if the expression is self-evaluating.
  isString(x)
Returns True if we see a string.
  isTaggedList(exp, tag)
Returns true if the expression is tagged with the 'tag'.
  isTrue(x)
  isUnquoted(exp)
  isVariable(exp)
Returns true if the expression looks like a symbol.
  lambdaBody(exp)
  lambdaParameters(exp)
  letBindings(exp)
  letBindingValues(bindings)
  letBindingVariables(bindings)
  letBody(exp)
  letToApplication(exp)
  makeApplication(operators, operands)
  makeAssignment(var, val)
  makeBegin(seq)
  makeContinuationProcedure(proc)
Procedure is defined to be a function that takes a single 'val' argument.
  makeDefinition(var, val)
  makeIf(predicate, consequent, alternative)
  makeLambda(parameters, body)
  makePrimitiveProcedure(proc)
  makeProcedure(parameters, body, env)
  makeQuoted(exp)
  operands(exp)
  operator(exp)
  primitiveImplementation(proc)
  procedureBody(p)
  procedureEnvironment(p)
  procedureParameters(p)
  restExps(seq)
  restOperands(ops)
  sequenceToExp(seq)
  textOfQuotation(exp)
  textOfUnquotation(exp)
  toString(expr, quoteStrings)
Given a Scheme expression, returns a string that tries to nicely return it as a string.

Variable Summary
str __license__ = 'MIT License'

Function Details

expandQuasiquotation(exp, depth=1)

Takes a quasiquoted expression and constructs a new quoted
expression.

FIXME: this function is SO evil.  *grin*  Must clean this up.

isAssignment(exp)

Assignments have the form (set! <var> <value>).

isNumber(x)

Returns True if we see a number.

isSelfEvaluating(exp)

Returns True if the expression is self-evaluating.

isString(x)

Returns True if we see a string.

isTaggedList(exp, tag)

Returns true if the expression is tagged with the 'tag'.

isVariable(exp)

Returns true if the expression looks like a symbol.

makeContinuationProcedure(proc)

Procedure is defined to be a function that takes a single 'val'
argument.

toString(expr, quoteStrings=1)

Given a Scheme expression, returns a string that tries to nicely
return it as a string.

If quoteStrings is true, puts quotes around string expressions.

Notes: this is a little tricky just because we have to account for
loopy structures.  We keep a set of expressions that we've already
seen, to make sure we don't retrace any steps.

Variable Details

__license__

Type:
str
Value:
'MIT License'                                                          

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