aboutsummaryrefslogtreecommitdiff
path: root/ps/interop.ps
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-10-09 23:48:47 -0500
committerJoel Martin <github@martintribe.org>2015-01-06 21:57:24 -0600
commit01c9731649a7ed97fad0bdeac9cb75b7323c0ad6 (patch)
treed6d00e574c489b206ddf78adc12c3d535bab7440 /ps/interop.ps
parent1771ab50b87c745181e4e30f94b63e3f23d33dac (diff)
downloadmal-01c9731649a7ed97fad0bdeac9cb75b7323c0ad6.tar.gz
mal-01c9731649a7ed97fad0bdeac9cb75b7323c0ad6.zip
All: swap step9,A. Fixes for bash, C, perl.
step9_interop -> stepA_interop stepA_more -> step9_try C: fix glib headers bash: behavior change of declare -A and pattern replacement. perl: squelch new 5.18 warnings related to switch/given statement. Also, include some in-progress interop related files.
Diffstat (limited to 'ps/interop.ps')
-rw-r--r--ps/interop.ps21
1 files changed, 21 insertions, 0 deletions
diff --git a/ps/interop.ps b/ps/interop.ps
new file mode 100644
index 0000000..fb3b88d
--- /dev/null
+++ b/ps/interop.ps
@@ -0,0 +1,21 @@
+% ps_val -> ps2mal -> mal_val
+/ps2mal {
+ % convert a PS value to a Mal value (recursively)
+ [ exch
+ { %forall returned values
+ dup ==
+ dup type /arraytype eq {
+ (here1\n) print
+ _list_from_array
+ }{ dup type /dicttype eq {
+ (here2\n) print
+ _hash_map_from_dict
+ }{
+ (here3\n) print
+ % no-op
+ } ifelse } ifelse
+ } forall
+ ]
+ (here4\n) print
+} def
+