From 01586921b3d5f2ac1ccf8196d3ad9b4b3ddd31f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Vulquin?= Date: Wed, 24 Jul 2024 19:19:26 +0200 Subject: nvim: rewrite config in fennel One file isn't done, and there's also the question of ftplugin and co. One step at a time though, eh? --- dot_config/nvim/fnl/toast/table.fnl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 dot_config/nvim/fnl/toast/table.fnl (limited to 'dot_config/nvim/fnl/toast/table.fnl') diff --git a/dot_config/nvim/fnl/toast/table.fnl b/dot_config/nvim/fnl/toast/table.fnl new file mode 100644 index 0000000..a294b14 --- /dev/null +++ b/dot_config/nvim/fnl/toast/table.fnl @@ -0,0 +1,15 @@ +(fn from-pairs [t ?mut] + "Convert a list of [k v] pairs to a table. + If an initial table ?mut is provided, it will be mutated and returned." + (let [out (or ?mut {})] + (each [_ [k v] (ipairs t)] + (tset out k v)) + out)) + +(fn insert [t ...] + "Like table.insert, but returns the mutated table." + (table.insert t ...) + t) + +{: from-pairs + : insert} -- cgit v1.2.3