aboutsummaryrefslogtreecommitdiff
path: root/make/step8_macros.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/step8_macros.mk
parent718887c3019c49fc807bc18fbd5feb975ec03c85 (diff)
downloadmal-86b689f3d7111a9fa13da389a30f3dfdf877d1a4.tar.gz
mal-86b689f3d7111a9fa13da389a30f3dfdf877d1a4.zip
All: *ARGV* and *host-language*. Misc syncing/fixes.
Diffstat (limited to 'make/step8_macros.mk')
-rw-r--r--make/step8_macros.mk8
1 files changed, 6 insertions, 2 deletions
diff --git a/make/step8_macros.mk b/make/step8_macros.mk
index f4234d2..5a0007c 100644
--- a/make/step8_macros.mk
+++ b/make/step8_macros.mk
@@ -146,6 +146,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! not (fn* (a) (if a false true))) ))
@@ -155,11 +157,13 @@ $(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
+# repl loop
$(if $(strip $(INTERACTIVE)),$(call REPL))