I'm probably missing something simple here but... I've got a list of alists parsed from JSON using json-parse-string
. The list of alists is like the following (details omitted for brevity):
( ((id . 1) (url . "http://gnu.org") (description . "GNU Operating System"))
((id . 2) (url . "http://fsf.org") (description . "Free Software Foundation")) ... )
I'm trying to retrieve an alist from the list by the value associated to id
in the alist.
E.g. (function 2 list)
would return ((id . 2) (url . "http://fsf.org") (description . "Free Software Foundation"))
Obviously I could while
or cl-loop
over the list to find this out, but what is more a Lispy way of doing this?