From 8178be9efa1d4c88808268f0f27ae5a3f63d1b3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Vulquin?= Date: Fri, 26 Jul 2024 23:00:20 +0200 Subject: nvim: update :toast.core/assoc Thank you Olical for updating fennel! Move to `(set (. t k) v)` for overwriting non-insertion list elements. Also don't bother specifying a `k` for the insertion case, seeing as we know for a fact it's just the final element. --- dot_config/nvim/fnl/toast/core.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dot_config/nvim/fnl/toast/core.fnl b/dot_config/nvim/fnl/toast/core.fnl index 16e69c2..2a426d1 100644 --- a/dot_config/nvim/fnl/toast/core.fnl +++ b/dot_config/nvim/fnl/toast/core.fnl @@ -58,8 +58,8 @@ [k v & xs] [...]] (case k nil nil - (where k (and (number? k) (> lt k))) (tset t k v) ; TODO: (set (. t k) v) - (where k (and (number? k) (= k lt))) (table.insert t k v) + (where k (and (number? k) (> lt k))) (set (. t k) v) + (where k (and (number? k) (= k lt))) (table.insert t v) _ (tset t k v)) (case (length xs) 0 t -- cgit v1.2.3