aboutsummaryrefslogtreecommitdiff
path: root/python/core.py
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-04-16 23:57:50 -0500
committerJoel Martin <github@martintribe.org>2014-04-16 23:57:50 -0500
commit8cb5cda46cf3aef847ae3926dc53a5e5f87fe261 (patch)
tree13e5b2878f19ee24272ead8a92a9cb84b33ad0e5 /python/core.py
parenta05f7822b10ed4cdd61ed8384299a003baf1c1c6 (diff)
downloadmal-8cb5cda46cf3aef847ae3926dc53a5e5f87fe261.tar.gz
mal-8cb5cda46cf3aef847ae3926dc53a5e5f87fe261.zip
All: move some fns to core. Major cleanup.
- Don't import/require core until step4. - Define cond/or macros from step8
Diffstat (limited to 'python/core.py')
-rw-r--r--python/core.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/core.py b/python/core.py
index 20ac793..54737aa 100644
--- a/python/core.py
+++ b/python/core.py
@@ -3,6 +3,8 @@ from itertools import chain
import mal_types as types
from mal_types import List, Vector
+import mal_readline
+import reader
import printer
# Errors/Exceptions
@@ -112,10 +114,14 @@ ns = {
'false?': types._false_Q,
'symbol': types._symbol,
'symbol?': types._symbol_Q,
+
'pr-str': pr_str,
'str': do_str,
'prn': prn,
'println': println,
+ 'readline': lambda prompt: mal_readline.readline(prompt),
+ 'read-string': reader.read_str,
+ 'slurp': lambda file: open(file).read(),
'<': lambda a,b: a<b,
'<=': lambda a,b: a<=b,
'>': lambda a,b: a>b,