diff options
Diffstat (limited to 'make/step9_interop.mk')
| -rw-r--r-- | make/step9_interop.mk | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/make/step9_interop.mk b/make/step9_interop.mk index 2dfe7e0..07ad5a3 100644 --- a/make/step9_interop.mk +++ b/make/step9_interop.mk @@ -150,6 +150,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))) )) @@ -159,11 +161,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)) |
