From 79445fd962dd8bb520fc43800b7da585dbf2d908 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Wed, 14 Aug 2024 22:34:37 +0100 Subject: [PATCH] support multi-arg assoc --- pkgs/anoia/init.fnl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/anoia/init.fnl b/pkgs/anoia/init.fnl index 0b2f79e..75c2185 100644 --- a/pkgs/anoia/init.fnl +++ b/pkgs/anoia/init.fnl @@ -1,6 +1,8 @@ -(fn assoc [tbl k v] +(fn assoc [tbl k v & more] (tset tbl k v) - tbl) + (case more + [k v] (assoc tbl k v) + _ tbl)) (fn merge [table1 table2] (collect [k v (pairs table2) &into table1]