alist set - part-cw/lambdanative GitHub Wiki
(alist-set alist key . keyvals)
Returns a new association list with the added items.
Parameter | Description |
---|---|
alist | association list |
keyval | keys and values to set |
Example
> (define a '((1 "2")(3 4)))
> (alist-ref a 1)
"2"
> (alist-ref a 4 'undefined)
undefined
> (alist-refstr a 3 "")
"4"
> (alist-refnum a 1 0)
2
> (set! a (alist-set a 1 "replaced" 5 'new))
> (alist-ref a 1)
"replaced"
> (set! a (alist-delkeys a 1 3))
> (alist-ref a 1)
#f