cute little test. still fscked.

This commit is contained in:
Paul Tagliamonte 2012-12-16 14:57:39 -05:00
parent 154ba2dfe4
commit 868d1cbd6e
2 changed files with 19 additions and 0 deletions

View File

@ -20,3 +20,11 @@ class HYExpression(list, HYObject):
"function": fn,
"args": args
}
def __call__(self, *args, **kwargs):
things = []
fn = self.get_invocation()['function']
for child in self.get_children():
things.append(child())
return self.namespace[fn](*things)

11
test.py Normal file
View File

@ -0,0 +1,11 @@
from hy.compiler.modfaker import forge_module
from hy.lex.tokenize import tokenize
m = forge_module(
'test',
'test.hy',
tokenize('(def two (+ 1 1))')
)
print m.two