def evalSequence(exps, env, cont): def c(val): return evalSequence(expressions.restExps(exps), env, cont) if expressions.isLastExp(exps): return teval(expressions.firstExp(exps), env, cont) else: return teval(expressions.firstExp(exps), env, c)
def analyzeSequence(exps): def sequentially(analyzedFirst, analyzedSecond): def c(env, cont): def c_first_exec(ignoredVal): return pogo.bounce(analyzedSecond, env, cont) return pogo.bounce(analyzedFirst, env, c_first_exec) return c if pair.isNull(exps): raise SchemeError, "Empty sequence -- ANALYZE" analyzedSeqs = analyze(expressions.firstExp(exps)) exps = expressions.restExps(exps) while not pair.isNull(exps): analyzedSeqs = sequentially(analyzedSeqs, analyze(expressions.firstExp(exps))) exps = expressions.restExps(exps) return analyzedSeqs