diff options
| author | Joel Martin <github@martintribe.org> | 2014-04-17 21:49:07 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2014-04-17 21:49:07 -0500 |
| commit | db4c329aff4621e05b92a55be4f18173f5a4f655 (patch) | |
| tree | 92baaa6d88246e509cfd6a7d03d8fab997e0b935 /python/stepA_more.py | |
| parent | 8cb5cda46cf3aef847ae3926dc53a5e5f87fe261 (diff) | |
| download | mal-db4c329aff4621e05b92a55be4f18173f5a4f655.tar.gz mal-db4c329aff4621e05b92a55be4f18173f5a4f655.zip | |
All: perf test, Makefile refactor, add *host-language*
Other:
- bash,make,postscript: quasiquote of vectors
- Fix Java slurp
- add time function to core.mal
- switches on *host-language* for make time-secs vs time-ms
- Ignore */experiments directories
Diffstat (limited to 'python/stepA_more.py')
| -rw-r--r-- | python/stepA_more.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/python/stepA_more.py b/python/stepA_more.py index fa79ec3..e4bc768 100644 --- a/python/stepA_more.py +++ b/python/stepA_more.py @@ -58,7 +58,7 @@ def eval_ast(ast, env): def EVAL(ast, env): while True: - #print("EVAL %s" % ast) + #print("EVAL %s" % printer._pr_str(ast)) if not types._list_Q(ast): return eval_ast(ast, env) @@ -150,6 +150,7 @@ for k, v in core.ns.items(): repl_env.set(k, v) repl_env.set('eval', lambda ast: EVAL(ast, repl_env)) # core.mal: defined using the language itself +REP("(def! *host-language* \"python\")") REP("(def! not (fn* (a) (if a false true)))") REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))") REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))") |
