liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 79445fd962dd8bb520fc43800b7da585dbf2d908
parent a9ddd78482d0113a570cb7302e00aa91b4567ecf
Author: Daniel Barlow <dan@telent.net>
Date:   Wed, 14 Aug 2024 22:34:37 +0100

support multi-arg assoc

Diffstat:
Mpkgs/anoia/init.fnl | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 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]