You might see if your language supports lenses - a lot of ML-like languages can do something like:
get({ a: { b: { c: ['foo'] } } }, a *> b *> c *> _0)
and a macro to unfold the lens from a literal string is probably something that exists as well.