in reply to
flattening Complex Datastructures
great responses, thanks.
time was, I could move my arms like a bird and...
Im not too smart with the big O notation, but I did realise that grabbing subtrees or grouping by a specific node would slow right down. I suppose there must be algorithms and other comp.sci stuff that can minimize that?.
In hindsight, i think what appeals the most about this, is that it flattens a HoH to single key/value pairs, but preserves the internal structure. Translating between these two structures seems like it could be handy for...umm, loads of stuff. Multi-level CGI params, dumping/slurping data-structures in EMCA-esque script...loads of stuff!.
Well, I think curiosity is getting the better of me and Im gonna throw a module together and benchmark it. If anyone has ideas on improving the lookup deficiencies, or anything else, please feel free to contribute.