From ffbb362d3cb3430637a6037e4b65590e8b0d00ce Mon Sep 17 00:00:00 2001 From: Paul Tagliamonte Date: Tue, 18 Dec 2012 23:28:39 -0500 Subject: [PATCH] cleaning some things up --- bin/hython | 2 +- hy/lang/builtins.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/hython b/bin/hython index 1477689..2f343ca 100755 --- a/bin/hython +++ b/bin/hython @@ -7,7 +7,7 @@ from code import InteractiveConsole import sys if len(sys.argv) > 1: - mod = _hy_import_file(sys.argv[1], '') + mod = _hy_import_file(sys.argv[1], '__main__') sys.exit(0) diff --git a/hy/lang/builtins.py b/hy/lang/builtins.py index dcc0e80..fd76fdf 100644 --- a/hy/lang/builtins.py +++ b/hy/lang/builtins.py @@ -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 }