This commit is contained in:
Kartik K. Agaram 2021-07-03 16:28:15 -07:00
parent d986404ff0
commit 7ced4e44dd
1 changed files with 13 additions and 0 deletions

View File

@ -101,6 +101,19 @@
if (f (car xs))
(cons (car xs) rest)
rest])
(alist? . [def (alist? x)
(and (cons? x)
(cons? (car x)))])
(assoc . [def (assoc alist key)
if (no alist)
()
if (key = (caar alist))
(car alist)
(assoc (cdr alist) key)])
(get . [def (get alist key)
aif (assoc alist key)
(cdr it)
()])
(++ . [mac (++ var) `(set ,var (,var + 1))])
(+= . [mac (var += inc)
`(set ,var (,var + ,inc))])