aboutsummaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-rw-r--r--make/core.mk3
-rw-r--r--make/step7_quote.mk2
-rw-r--r--make/step8_macros.mk2
-rw-r--r--make/step9_interop.mk2
-rw-r--r--make/stepA_more.mk3
5 files changed, 8 insertions, 4 deletions
diff --git a/make/core.mk b/make/core.mk
index 80f51ac..2ee6597 100644
--- a/make/core.mk
+++ b/make/core.mk
@@ -48,6 +48,8 @@ number_subtract = $(call _pnumber,$(call int_subtract,$($(word 1,$(1))_value),$(
number_multiply = $(call _pnumber,$(call int_multiply,$($(word 1,$(1))_value),$($(word 2,$(1))_value)))
number_divide = $(call _pnumber,$(call int_divide,$($(word 1,$(1))_value),$($(word 2,$(1))_value)))
+time_secs = $(call _number,$(shell echo $$(( $$(date +%s) % 65536 ))))
+
# String functions
@@ -229,6 +231,7 @@ core_ns = type obj_type \
- number_subtract \
* number_multiply \
/ number_divide \
+ time-secs time_secs \
\
list _list \
list? list? \
diff --git a/make/step7_quote.mk b/make/step7_quote.mk
index af14e85..072e407 100644
--- a/make/step7_quote.mk
+++ b/make/step7_quote.mk
@@ -18,7 +18,7 @@ $(if $(READLINE_EOF)$(__ERROR),,$(call READ_STR,$(if $(1),$(1),$(call READLINE,"
endef
# EVAL: evaluate the parameter
-IS_PAIR = $(if $(call _EQ,list,$(call _obj_type,$(1))),$(if $(call _EQ,0,$(call _count,$(1))),,true),)
+IS_PAIR = $(if $(call _sequential?,$(1)),$(if $(call _EQ,0,$(call _count,$(1))),,true),)
define QUASIQUOTE
$(strip \
diff --git a/make/step8_macros.mk b/make/step8_macros.mk
index 8ed5df8..f4234d2 100644
--- a/make/step8_macros.mk
+++ b/make/step8_macros.mk
@@ -18,7 +18,7 @@ $(if $(READLINE_EOF)$(__ERROR),,$(call READ_STR,$(if $(1),$(1),$(call READLINE,"
endef
# EVAL: evaluate the parameter
-IS_PAIR = $(if $(call _EQ,list,$(call _obj_type,$(1))),$(if $(call _EQ,0,$(call _count,$(1))),,true),)
+IS_PAIR = $(if $(call _sequential?,$(1)),$(if $(call _EQ,0,$(call _count,$(1))),,true),)
define QUASIQUOTE
$(strip \
diff --git a/make/step9_interop.mk b/make/step9_interop.mk
index 8c9220c..2dfe7e0 100644
--- a/make/step9_interop.mk
+++ b/make/step9_interop.mk
@@ -18,7 +18,7 @@ $(if $(READLINE_EOF)$(__ERROR),,$(call READ_STR,$(if $(1),$(1),$(call READLINE,"
endef
# EVAL: evaluate the parameter
-IS_PAIR = $(if $(call _EQ,list,$(call _obj_type,$(1))),$(if $(call _EQ,0,$(call _count,$(1))),,true),)
+IS_PAIR = $(if $(call _sequential?,$(1)),$(if $(call _EQ,0,$(call _count,$(1))),,true),)
define QUASIQUOTE
$(strip \
diff --git a/make/stepA_more.mk b/make/stepA_more.mk
index 00ae252..8b92178 100644
--- a/make/stepA_more.mk
+++ b/make/stepA_more.mk
@@ -18,7 +18,7 @@ $(if $(READLINE_EOF)$(__ERROR),,$(call READ_STR,$(if $(1),$(1),$(call READLINE,"
endef
# EVAL: evaluate the parameter
-IS_PAIR = $(if $(call _EQ,list,$(call _obj_type,$(1))),$(if $(call _EQ,0,$(call _count,$(1))),,true),)
+IS_PAIR = $(if $(call _sequential?,$(1)),$(if $(call _EQ,0,$(call _count,$(1))),,true),)
define QUASIQUOTE
$(strip \
@@ -167,6 +167,7 @@ $(call _import_core,$(core_ns))
REPL_ENV := $(call ENV_SET,$(REPL_ENV),eval,$(call _function,$$(call EVAL,$$(1),$$(REPL_ENV))))
# core.mal: defined in terms of the language itself
+$(call do,$(call REP, (def! *host-language* "make") ))
$(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) ")"))))) ))
$(call do,$(call REP, (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs))))))) ))