aboutsummaryrefslogtreecommitdiff
path: root/make/stepA_more.mk
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-04-19 13:04:09 -0500
committerJoel Martin <github@martintribe.org>2014-04-19 13:04:09 -0500
commit86b689f3d7111a9fa13da389a30f3dfdf877d1a4 (patch)
treed72b065f9f987e291f892ceee5a8640363bfd9df /make/stepA_more.mk
parent718887c3019c49fc807bc18fbd5feb975ec03c85 (diff)
downloadmal-86b689f3d7111a9fa13da389a30f3dfdf877d1a4.tar.gz
mal-86b689f3d7111a9fa13da389a30f3dfdf877d1a4.zip
All: *ARGV* and *host-language*. Misc syncing/fixes.
Diffstat (limited to 'make/stepA_more.mk')
-rw-r--r--make/stepA_more.mk12
1 files changed, 9 insertions, 3 deletions
diff --git a/make/stepA_more.mk b/make/stepA_more.mk
index 8b92178..dc07b01 100644
--- a/make/stepA_more.mk
+++ b/make/stepA_more.mk
@@ -165,6 +165,8 @@ _fref = $(eval REPL_ENV := $(call ENV_SET,$(REPL_ENV),$(1),$(call _function,$$(c
_import_core = $(if $(strip $(1)),$(call _fref,$(word 1,$(1)),$(word 2,$(1)))$(call _import_core,$(wordlist 3,$(words $(1)),$(1))),)
$(call _import_core,$(core_ns))
REPL_ENV := $(call ENV_SET,$(REPL_ENV),eval,$(call _function,$$(call EVAL,$$(1),$$(REPL_ENV))))
+_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") ))
@@ -175,11 +177,15 @@ $(call do,$(call REP, (defmacro! or (fn* (& xs) (if (empty? xs) nil (if (= 1 (co
# Load and eval any files specified on the command line
$(if $(MAKECMDGOALS),\
- $(foreach file,$(MAKECMDGOALS),$(call do,$(call REP, (load-file "$(file)") )))\
+ $(foreach arg,$(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)),\
+ $(call do,$(call _conj!,$(_argv),$(call _string,$(arg)))))\
+ $(call do,$(call REP, (load-file "$(word 1,$(MAKECMDGOALS))") )) \
$(eval INTERACTIVE :=),)
.PHONY: none $(MAKECMDGOALS)
none $(MAKECMDGOALS):
@true
-# Call the read-eval-print loop
-$(if $(strip $(INTERACTIVE)),$(call REPL))
+# repl loop
+$(if $(strip $(INTERACTIVE)),\
+ $(call do,$(call REP, (println (str "Mal [" *host-language* "]")) )) \
+ $(call REPL))