cleaning some things up
This commit is contained in:
parent
d4ed65ff63
commit
ffbb362d3c
@ -7,7 +7,7 @@ from code import InteractiveConsole
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
mod = _hy_import_file(sys.argv[1], '<stdin>')
|
mod = _hy_import_file(sys.argv[1], '__main__')
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,6 +55,15 @@ def _import(obj, lns):
|
|||||||
ns[basename] = mod
|
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):
|
def _if(obj, lns):
|
||||||
fd = obj.get_invocation()
|
fd = obj.get_invocation()
|
||||||
args = fd['args']
|
args = fd['args']
|
||||||
@ -70,5 +79,6 @@ builtins = {
|
|||||||
"import": _import,
|
"import": _import,
|
||||||
"kwapply": _kwapply,
|
"kwapply": _kwapply,
|
||||||
"if": _if,
|
"if": _if,
|
||||||
"loop": _loop
|
"loop": _loop,
|
||||||
|
"progn": _progn
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user