From 96f1845afdb816515bba83ad4bb8fee6bc466557 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Fri, 2 Jan 2015 23:33:50 -0600 Subject: Misc cleanup. Move *host-language* to stepA. --- ps/step9_try.ps | 2 -- ps/stepA_interop.ps | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ps') diff --git a/ps/step9_try.ps b/ps/step9_try.ps index 9c5c240..d9beec7 100644 --- a/ps/step9_try.ps +++ b/ps/step9_try.ps @@ -244,7 +244,6 @@ core_ns { _function _ref } forall (*ARGV*) [ ] _list_from_array _ref % core.mal: defined using the language itself -(\(def! *host-language* "postscript"\)) RE pop (\(def! not \(fn* \(a\) \(if a false true\)\)\)) RE pop (\(def! load-file \(fn* \(f\) \(eval \(read-string \(str "\(do " \(slurp f\) "\)"\)\)\)\)\)) RE pop (\(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\)\)\)\)\)\)\)) RE pop @@ -261,7 +260,6 @@ userdict /ARGUMENTS known { %if command line arguments } if % repl loop -(\(println \(str "Mal [" *host-language* "]"\)\)) RE pop { %loop (user> ) _readline not { exit } if % exit if EOF diff --git a/ps/stepA_interop.ps b/ps/stepA_interop.ps index a24ee28..c879294 100644 --- a/ps/stepA_interop.ps +++ b/ps/stepA_interop.ps @@ -150,8 +150,10 @@ end } def { token not { exit } if exch + count stackcnt sub 1 roll % send leftover string to bottom + exec + count stackcnt sub -1 roll % bring leftover string to top } loop - exec count stackcnt gt { % if new operands on stack % return an list of new operands count stackcnt sub array astore -- cgit v1.2.3