This commit is contained in:
Paul Tagliamonte 2012-12-16 21:34:41 -05:00
parent 0ec30fd75b
commit 3b7caa92e2
2 changed files with 7 additions and 5 deletions

View File

@ -7,9 +7,6 @@ class HYObject(object):
def get_children(self):
return []
def eval(self, *args, **kwargs):
return self
def __call__(self, *args, **kwargs):
return self.eval(*args, **kwargs)
@ -27,4 +24,9 @@ class HYObject(object):
if callee:
return callee
raise Exception
raise Exception("No such symbol: `%s`" % (fn))
def eval(self, *args, **kwargs):
for node in self.get_children():
node.eval(*args, **kwargs)
return self

View File

@ -7,5 +7,5 @@ class HYSymbol(unicode, HYObject):
def eval(self, *args, **kwargs):
if self.isdigit():
return float(self)
return int(self)
return self.lookup(self)