def schemeLoad(self, cont, env, args): """Special primitive: implements LOAD.""" symbolicFilename = str(args[0]) try: f = open(symbolicFilename) try: text = "(begin \n%s\n 'ok)" % f.read() finally: f.close() expandedExp = self.get_expander().expand(parser.parse(text)) analyzedExp = analyzer.analyze(expandedExp) return analyzer.texec(analyzedExp, env, cont) except IOError, e: raise error.SchemeError, "LOAD error -- %s" % str(e)
def schemeEval(self, cont, env, args): expandedExp = self.get_expander().expand(args[0]) analyzedExp = analyzer.analyze(expandedExp) return analyzer.texec(analyzedExp, env, cont)