aboutsummaryrefslogtreecommitdiff
path: root/ps
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2015-01-02 23:33:50 -0600
committerJoel Martin <github@martintribe.org>2015-01-09 16:16:55 -0600
commit96f1845afdb816515bba83ad4bb8fee6bc466557 (patch)
tree6fd8d7949ba26863d17122160a488db216fd1b81 /ps
parentf522319598c701efde91a78b07110d7039a8c906 (diff)
downloadmal-96f1845afdb816515bba83ad4bb8fee6bc466557.tar.gz
mal-96f1845afdb816515bba83ad4bb8fee6bc466557.zip
Misc cleanup. Move *host-language* to stepA.
Diffstat (limited to 'ps')
-rw-r--r--ps/step9_try.ps2
-rw-r--r--ps/stepA_interop.ps4
2 files changed, 3 insertions, 3 deletions
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