Permalink
Browse files

ch4

  • Loading branch information...
1 parent a1e7d72 commit 15c688ec9ecdb6dadb21405df706d37a4dba7da0 @flaming0 committed Sep 30, 2012
Showing with 2 additions and 6 deletions.
  1. +1 −4 ch4/interpreter-python/Environment.py
  2. +1 −2 ch4/interpreter-python/Expression.py
@@ -18,9 +18,6 @@ def set(self, variable, value):
else:
if self.baseEnv:
self.baseEnv.set(variable, value)
- else:
- raise EnvironmentException
- #print("Environment after setting var:val", self.frame)
def lookup(self, variable):
if variable.raw[0] in self.frame.keys():
@@ -29,7 +26,7 @@ def lookup(self, variable):
if self.baseEnv:
return self.baseEnv.lookup(variable)
else:
- raise UnboundVariableException
+ return None
globalEnvironment = Environment({ "+" : lambda *args: reduce(lambda x, y: x + y, args),
@@ -74,8 +74,7 @@ def createList(tokens):
return Expression.fromPythonList(resList)
def eval(self, env):
- return self
- #raise PureVirtualFunctionCall
+ raise PureVirtualFunctionCall
class AssignmentExpression(Expression):

0 comments on commit 15c688e

Please sign in to comment.