All: move some fns to core. Major cleanup.
[jackhill/mal.git] / make / step7_quote.mk
index 46e5130..af14e85 100644 (file)
@@ -118,21 +118,13 @@ REPL_ENV := $(call ENV)
 REP = $(call PRINT,$(strip $(call EVAL,$(strip $(call READ,$(1))),$(REPL_ENV))))
 REPL = $(info $(call REP,$(call READLINE,"user> ")))$(if $(READLINE_EOF),,$(call REPL))
 
-# Setup the environment
-_ref = $(eval REPL_ENV := $(call ENV_SET,$(REPL_ENV),$(1),$(if $(2),$(2),$(1))))
+# core.mk: defined using Make
 _fref = $(eval REPL_ENV := $(call ENV_SET,$(REPL_ENV),$(1),$(call _function,$$(call $(2),$$1))))
-
-# Import core namespace
 _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))))
 
-$(call _ref,read-string,$(call _function,$$(call READ_STR,$$(1))))
-$(call _ref,eval,$(call _function,$$(call EVAL,$$(1),$$(REPL_ENV))))
-
-_slurp = $(call _string,$(call _read_file,$(1)))
-$(call _ref,slurp,$(call _function,$$(call _slurp,$$(call str_decode,$$($$(1)_value)))))
-
-# Defined in terms of the language itself
+# core.mal: defined in terms of the language itself
 $(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) ")"))))) ))