cleaning some things up

This commit is contained in:
Paul Tagliamonte 2012-12-18 23:28:39 -05:00
parent d4ed65ff63
commit ffbb362d3c
2 changed files with 12 additions and 2 deletions

View File

@ -7,7 +7,7 @@ from code import InteractiveConsole
import sys
if len(sys.argv) > 1:
mod = _hy_import_file(sys.argv[1], '<stdin>')
mod = _hy_import_file(sys.argv[1], '__main__')
sys.exit(0)

View File

@ -55,6 +55,15 @@ def _import(obj, lns):
ns[basename] = mod
def _progn(obj, lns):
fd = obj.get_invocation()
args = fd['args']
ret = []
for arg in args:
ret.append(arg.eval(lns.clone()))
return ret
def _if(obj, lns):
fd = obj.get_invocation()
args = fd['args']
@ -70,5 +79,6 @@ builtins = {
"import": _import,
"kwapply": _kwapply,
"if": _if,
"loop": _loop
"loop": _loop,
"progn": _progn
}