updates
This commit is contained in:
parent
0ec30fd75b
commit
3b7caa92e2
@ -7,9 +7,6 @@ class HYObject(object):
|
|||||||
def get_children(self):
|
def get_children(self):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def eval(self, *args, **kwargs):
|
|
||||||
return self
|
|
||||||
|
|
||||||
def __call__(self, *args, **kwargs):
|
def __call__(self, *args, **kwargs):
|
||||||
return self.eval(*args, **kwargs)
|
return self.eval(*args, **kwargs)
|
||||||
|
|
||||||
@ -27,4 +24,9 @@ class HYObject(object):
|
|||||||
if callee:
|
if callee:
|
||||||
return 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
|
||||||
|
@ -7,5 +7,5 @@ class HYSymbol(unicode, HYObject):
|
|||||||
|
|
||||||
def eval(self, *args, **kwargs):
|
def eval(self, *args, **kwargs):
|
||||||
if self.isdigit():
|
if self.isdigit():
|
||||||
return float(self)
|
return int(self)
|
||||||
return self.lookup(self)
|
return self.lookup(self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user