Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 def schemeEval(self, cont, env, args):
     expandedExp = self.get_expander().expand(args[0])
     analyzedExp = analyzer.analyze(expandedExp)
     return analyzer.texec(analyzedExp, env, cont)
Пример #4
0
 def schemeEval(self, cont, env, args):
     expandedExp = self.get_expander().expand(args[0])
     analyzedExp = analyzer.analyze(expandedExp)
     return analyzer.texec(analyzedExp, env, cont)