support multi-arg assoc

This commit is contained in:
Daniel Barlow 2024-08-14 22:34:37 +01:00
parent a9ddd78482
commit 79445fd962
1 changed files with 4 additions and 2 deletions

View File

@ -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]