I'm trying to build a function (or macro) to ease the getting and setting of data deep in a hash table (meaning, a hash within a hash, within a hash, etc). I don't think I can do it with a macro, and I'm not sure how to do it with eval. I'd like to be able to do the following:

(gethashdeep *HEROES* "Avengers" "Retired" "Tony Stark")

and have that return "Iron Man"

The hashes are all created with:

(setf hashtablename (make-hash-table :test 'equal))

and populated from there.

I can do the following, but would like to abstract it so I can programmatically pull a value from an arbitrary depth:

;;pulling from a hash that's 2 deep (gethash "Tony Stark" (gethash "Avengers" *HEROES*))

update - my go at it: