aboutsummaryrefslogtreecommitdiff
path: root/python/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/core.py')
-rw-r--r--python/core.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/python/core.py b/python/core.py
index 8b01b69..20ac793 100644
--- a/python/core.py
+++ b/python/core.py
@@ -17,12 +17,12 @@ def do_str(*args):
return "".join(map(lambda exp: printer._pr_str(exp, False), args))
def prn(*args):
- print " ".join(map(lambda exp: printer._pr_str(exp, True), args))
+ print(" ".join(map(lambda exp: printer._pr_str(exp, True), args)))
return None
def println(*args):
line = " ".join(map(lambda exp: printer._pr_str(exp, False), args))
- print line.replace('\\n', '\n')
+ print(line.replace('\\n', '\n'))
return None
@@ -85,10 +85,7 @@ def mapf(f, lst): return List(map(f, lst))
# Metadata functions
def with_meta(obj, meta):
- if type(obj) == type(lambda x:x):
- new_obj = obj.__copy__()
- else:
- new_obj = copy.copy(obj)
+ new_obj = types._clone(obj)
new_obj.__meta__ = meta
return new_obj
@@ -126,7 +123,7 @@ ns = {
'+': lambda a,b: a+b,
'-': lambda a,b: a-b,
'*': lambda a,b: a*b,
- '/': lambda a,b: a/b,
+ '/': lambda a,b: int(a/b),
'list': types._list,
'list?': types._list_Q,