What is Nostr?
Paul SomeoneElse /
npub1y2p…el6u
2024-04-19 20:40:33

Paul SomeoneElse on Nostr: I really like association lists. I like that they can be treated as a hash-table just ...

I really like association lists.
I like that they can be treated as a hash-table just by pushing a new cons with the same name.

And 'assoc will grab the latest one.

I also like how you have to use cdr to get the value. Because it is more generally useful to return the whole cons, and not worth specializing to the typical case.

(push (cons "asd" 9000) l)
(push (cons "qwe" 56) l)
(push (cons "asd" 9001) l)
(cdr (assoc "asd" l :test 'equal))

...
Author Public Key
npub1y2p02vwdvgzv009rsmv4ze9mv9gg44t95dl2z8dgdvyz5ej2edqqcwel6u