aboutsummaryrefslogtreecommitdiff
path: root/make
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 /make
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 'make')
-rw-r--r--make/Makefile4
-rw-r--r--make/step9_try.mk (renamed from make/step9_interop.mk)22
-rw-r--r--make/stepA_interop.mk (renamed from make/stepA_more.mk)0
-rw-r--r--make/tests/stepA_interop.mal (renamed from make/tests/step9_interop.mal)0
4 files changed, 20 insertions, 6 deletions
diff --git a/make/Makefile b/make/Makefile
index 52a7a7d..bd19020 100644
--- a/make/Makefile
+++ b/make/Makefile
@@ -1,8 +1,8 @@
-TESTS = tests/types.mk tests/reader.mk tests/step9_interop.mk
+TESTS = tests/types.mk tests/reader.mk tests/stepA_interop.mk
SOURCES_BASE = util.mk readline.mk gmsl.mk types.mk reader.mk printer.mk
-SOURCES_LISP = env.mk core.mk stepA_more.mk
+SOURCES_LISP = env.mk core.mk stepA_interop.mk
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
mal.mk: $(SOURCES)
diff --git a/make/step9_interop.mk b/make/step9_try.mk
index 984740a..4c5b8c1 100644
--- a/make/step9_interop.mk
+++ b/make/step9_try.mk
@@ -99,10 +99,21 @@ $(if $(__ERROR),,\
$(if $(call ENV_SET,$(2),$($(a1)_value),$(res)),$(res),)))),\
$(if $(call _EQ,macroexpand,$($(a0)_value)),\
$(call MACROEXPAND,$(call _nth,$(1),1),$(2)),\
- $(if $(call _EQ,make*,$($(a0)_value)),\
+ $(if $(call _EQ,try*,$($(a0)_value)),\
$(foreach a1,$(call _nth,$(1),1),\
- $(and $(EVAL_DEBUG),$(info make*: $$(eval __result := $(call str_decode,$(value $(a1)_value)))))\
- $(eval __result := $(call str_decode,$(value $(a1)_value)))$(call _string,$(__result))),\
+ $(foreach res,$(call EVAL,$(a1),$(2)),\
+ $(if $(__ERROR),\
+ $(foreach a2,$(call _nth,$(1),2),\
+ $(foreach a20,$(call _nth,$(a2),0),\
+ $(if $(call _EQ,catch*,$($(a20)_value)),\
+ $(foreach a21,$(call _nth,$(a2),1),\
+ $(foreach a22,$(call _nth,$(a2),2),\
+ $(foreach binds,$(call _list,$(a21)),\
+ $(foreach catch_env,$(call ENV,$(2),$(binds),$(__ERROR)),\
+ $(eval __ERROR :=)\
+ $(call EVAL,$(a22),$(catch_env)))))),\
+ $(res)))),\
+ $(res)))),\
$(if $(call _EQ,do,$($(a0)_value)),\
$(call slast,$(call EVAL_AST,$(call srest,$(1)),$(2))),\
$(if $(call _EQ,if,$($(a0)_value)),\
@@ -154,6 +165,7 @@ _argv := $(call _list)
REPL_ENV := $(call ENV_SET,$(REPL_ENV),*ARGV*,$(_argv))
# core.mal: defined in terms of the language itself
+$(call do,$(call REP, (def! *host-language* "make") ))
$(call do,$(call REP, (def! not (fn* (a) (if a false true))) ))
$(call do,$(call REP, (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")"))))) ))
$(call do,$(call 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))))))) ))
@@ -167,7 +179,9 @@ $(if $(MAKECMDGOALS),\
$(eval INTERACTIVE :=),)
# repl loop
-$(if $(strip $(INTERACTIVE)),$(call REPL))
+$(if $(strip $(INTERACTIVE)),\
+ $(call do,$(call REP, (println (str "Mal [" *host-language* "]")) )) \
+ $(call REPL))
.PHONY: none $(MAKECMDGOALS)
none $(MAKECMDGOALS):
diff --git a/make/stepA_more.mk b/make/stepA_interop.mk
index 050366c..050366c 100644
--- a/make/stepA_more.mk
+++ b/make/stepA_interop.mk
diff --git a/make/tests/step9_interop.mal b/make/tests/stepA_interop.mal
index 9b1a2f9..9b1a2f9 100644
--- a/make/tests/step9_interop.mal
+++ b/make/tests/stepA_interop.mal