Пример #1
0
 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)
Пример #2
0
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)
Пример #3
0
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
Пример #4
0
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)