From 8cb5cda46cf3aef847ae3926dc53a5e5f87fe261 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Wed, 16 Apr 2014 23:57:50 -0500 Subject: All: move some fns to core. Major cleanup. - Don't import/require core until step4. - Define cond/or macros from step8 --- make/core.mk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'make/core.mk') diff --git a/make/core.mk b/make/core.mk index fbea5ea..80f51ac 100644 --- a/make/core.mk +++ b/make/core.mk @@ -8,6 +8,8 @@ __mal_core_included := true _TOP_DIR := $(dir $(lastword $(MAKEFILE_LIST))) include $(_TOP_DIR)util.mk include $(_TOP_DIR)types.mk +include $(_TOP_DIR)readline.mk +include $(_TOP_DIR)reader.mk include $(_TOP_DIR)printer.mk @@ -49,12 +51,16 @@ number_divide = $(call _pnumber,$(call int_divide,$($(word 1,$(1))_value),$($(wo # String functions +string? = $(if $(call _string?,$(1)),$(__true),$(__false)) + pr_str = $(call _string,$(call _pr_str_mult,$(1),yes, )) str = $(call _string,$(call _pr_str_mult,$(1),,)) prn = $(info $(call _pr_str_mult,$(1),yes, )) println = $(info $(subst \n,$(NEWLINE),$(call _pr_str_mult,$(1),, ))) -string? = $(if $(call _string?,$(1)),$(__true),$(__false)) +readline= $(foreach res,$(call _string,$(call READLINE,"$(call str_decode,$($(1)_value))")),$(if $(READLINE_EOF),$(__nil),$(res))) +read_str= $(call READ_STR,$(1)) +slurp = $(call _string,$(call _read_file,$(call str_decode,$($(1)_value)))) subs = $(strip \ $(foreach start,$(call gmsl_plus,1,$(call int_decode,$($(word 2,$(1))_value))),\ @@ -205,10 +211,14 @@ core_ns = type obj_type \ symbol? symbol? \ function? function? \ string? string? \ + \ pr-str pr_str \ str str \ prn prn \ println println \ + readline readline \ + read-string read_str \ + slurp slurp \ subs subs \ number? number? \ < number_lt \ -- cgit v1.2.3