in reply to Re: Nesting below emptiness and/or inverting a hash.
in thread Nesting below emptiness and/or inverting a hash.

Sure. Suppose that you can be given any hash at all, but only one slice at a time. So given the hash:
{ a => { b1=> { c11 => vc11, c12 => vc12 }, b2 => { c21 => vc21, c22 = +> vc22 } } }
you receive it one slice at a time in reverse order but with the level at which it is stored in the hash:
{ c21 => vc21, c22 => vc22 }, level=3 { c11 => vc11, c21 => vc12 }, level=3 { b2 => ?, b1 => ? }, level=2 { a => ? }, level =1.
You could simply test for level = 1 and then process that recursively down to level 3 (avoiding processing at level 4 being an issue). But sometimes there are reasons why you can't wait or more likely, it is just too hard or messy to stack up all the context (in my case, this is specifically the other control and literal data within the stack frame at the point the slice is first interpreted inwards) and then have to unravel it later. I might end up having to do that though anyway unless someone has a better suggestion - my initial placeholder idea (just what first popped into my head) is just too inelegant I feel.

-M

Free your mind