Skip to content
Chris Petersen edited this page Sep 11, 2015 · 2 revisions

Returns the numeric value associated with the given key, or the fallback if not found

Parameter Description
alist association list
key list key to lookup
fbnum fallback number

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
Clone this wiki locally