def t_expand_define(self, expr, cont): variable = expressions.definitionVariable(expr) value = expressions.definitionValue(expr) def c_expanded(expandedValue): return pogo.bounce( cont, expressions.makeDefinition(variable, expandedValue)) return pogo.bounce(self.t_expand, value, c_expanded)
def evalDefinition(exp, env, cont): def c(val): environment.defineVariable(expressions.definitionVariable(exp), val, env) return pogo.bounce(cont, Symbol("ok")) return teval(expressions.definitionValue(exp), env, c)
def analyzeDefinition(exp): defName = expressions.definitionVariable(exp) analyzedDefValue = analyze(expressions.definitionValue(exp)) def analyzed(env, cont): def c(defVal): environment.defineVariable(defName, defVal, env) return pogo.bounce(cont, Symbol("ok")) return pogo.bounce(analyzedDefValue, env, c) return analyzed
def evalDefinition(exp, env, cont): def c(val): environment.defineVariable( expressions.definitionVariable(exp), val, env) return pogo.bounce(cont, Symbol("ok")) return teval(expressions.definitionValue(exp), env, c)