From 1d2bba82b09710b0dc6ca4e1a515763088b3fbf5 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Mon, 26 Oct 2020 20:57:22 +0300 Subject: feature: refactoring make some functions private (for coverage.sh) Separate tests into one test per function (for coverage.sh) --- macros/core.fnl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'macros/core.fnl') diff --git a/macros/core.fnl b/macros/core.fnl index bf4dfe8..ed147ed 100644 --- a/macros/core.fnl +++ b/macros/core.fnl @@ -2,7 +2,7 @@ (local unpack (or table.unpack _G.unpack)) (local insert table.insert) -(fn check-bindings [bindings] +(fn -check-bindings [bindings] (and (assert-compile (sequence? bindings) "expected binding table" []) (assert-compile (= (length bindings) 2) "expected exactly two forms in binding vector." bindings))) @@ -10,7 +10,7 @@ ([bindings then] (if-let bindings then nil)) ([bindings then else] - (check-bindings bindings) + (-check-bindings bindings) (let [[form test] bindings] `(let [tmp# ,test] (if tmp# @@ -20,7 +20,7 @@ (fn* when-let [bindings & body] - (check-bindings bindings) + (-check-bindings bindings) (let [[form test] bindings] `(let [tmp# ,test] (if tmp# @@ -31,7 +31,7 @@ ([bindings then] (if-some bindings then nil)) ([bindings then else] - (check-bindings bindings) + (-check-bindings bindings) (let [[form test] bindings] `(let [tmp# ,test] (if (= tmp# nil) @@ -41,7 +41,7 @@ (fn* when-some [bindings & body] - (check-bindings bindings) + (-check-bindings bindings) (let [[form test] bindings] `(let [tmp# ,test] (if (= tmp# nil) @@ -50,15 +50,15 @@ ,(unpack body)))))) -(fn table-type [tbl] +(fn -table-type [tbl] (if (sequence? tbl) :seq (table? tbl) :table :else)) ;; based on `seq' from `core.fnl' (fn into [to from] - (local to-type (table-type to)) - (local from-type (table-type from)) + (local to-type (-table-type to)) + (local from-type (-table-type from)) `(let [to# ,to from# ,from insert# table.insert -- cgit v1.2.3