Skip to content

Instantly share code, notes, and snippets.

@joekarma
Created April 25, 2013 04:38
Show Gist options
  • Save joekarma/5457536 to your computer and use it in GitHub Desktop.
Save joekarma/5457536 to your computer and use it in GitHub Desktop.
CL-USER> (defun gethash* (hash-table key &rest more-keys)
(cond ((null more-keys) (gethash key hash-table))
(t (apply #'gethash*
(append (list (gethash key hash-table)
(car more-keys))
(cdr more-keys))))))
GETHASH*
CL-USER> (gethash* (yason:parse "{foo:{bar:{baz:42}}}") "foo" "bar" "baz")
42
T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment