From 54a83a9f0506804a597875f3eaf4de874bf6762f Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 22 Oct 2020 23:02:50 +0300 Subject: implement into as a macro --- core.fnl | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'core.fnl') diff --git a/core.fnl b/core.fnl index e1f3ae0..4890554 100644 --- a/core.fnl +++ b/core.fnl @@ -16,18 +16,6 @@ sequential table, leaves it unchanged." (insert res [k v])) (if assoc? res tbl))) -(fn unseq [tbl] - (local res {}) - (each [_ [k v] (ipairs tbl)] - (tset res k v)) - res) - -(fn into [to from] - (match to - :vec (seq from) - :map (unseq from) - _ (error "unsupported table type" 2))) - (fn first [itbl] "Return first element of an indexed table." (. (seq itbl) 1)) @@ -221,7 +209,6 @@ sorting tables first." )) {: seq - : into : mapv : mapkv : reduce -- cgit v1.2.3