summaryrefslogtreecommitdiff
path: root/dot_config/nvim/fnl/toast/table.fnl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dot_config/nvim/fnl/toast/table.fnl12
1 files changed, 11 insertions, 1 deletions
diff --git a/dot_config/nvim/fnl/toast/table.fnl b/dot_config/nvim/fnl/toast/table.fnl
index fe118e8..17934b2 100644
--- a/dot_config/nvim/fnl/toast/table.fnl
+++ b/dot_config/nvim/fnl/toast/table.fnl
@@ -11,8 +11,18 @@
(table.insert t ...)
t)
+(fn concat [...]
+ "Join an arbitrary amount of tables.
+ Equivalent to a single 'layer' of flat."
+ (let [out []]
+ (each [_ xs (ipairs [...])]
+ (each [_ v (ipairs xs)]
+ (insert out v)))
+ out))
+
(local unpack (or table.unpack unpack))
{: from-pairs
: insert
- : unpack}
+ : unpack
+ : concat}