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
def c(val): return evalSequence(expressions.restExps(exps), env, cont)