alist refstr - part-cw/lambdanative GitHub Wiki
(alist-refstr alist key fbstr)
Returns the stringified value associated with the given key, or the fallback if not found
Parameter | Description |
---|---|
alist | association list |
key | list key to lookup |
fbstr | fallback string |
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