def schemeCallcc(self, cont, env, args): analyzedLambdaBody = args[0] def c2(val): return pogo.bounce(cont, val) cont_procedure = expressions.makeContinuationProcedure(c2) return analyzer.apply(analyzedLambdaBody, pair.list(cont_procedure), env, cont)
def apply(self, proc, args): """Call the scheme procedure""" # NOTE: This is specific to AnalyzerInterpreter (and MinimalInterpreter) # which we used. But RegularInterpreter should use evaluator.apply instead. try: return pogo.pogo( analyzer.apply(proc, self.toscheme(args, shallow=True), self._interp.get_environment(), pogo.land)) except Exception, e: self._parse_error(e)
def apply(self, proc, args): """Call the scheme procedure""" # NOTE: This is specific to AnalyzerInterpreter (and MinimalInterpreter) # which we used. But RegularInterpreter should use evaluator.apply instead. try: return pogo.pogo(analyzer.apply(proc, self.toscheme(args, shallow=True), self._interp.get_environment(), pogo.land)) except Exception, e: self._parse_error(e)
def schemeApply(self, cont, env, args): return analyzer.apply(args[0], args[1], env, cont)