in reply to Dynamic hash keys
Is there any way of changing BOTH 'that' to 'them'?
Sure, just do two assignments. Or in the case of hash keys, delete the old one, and add the contents back in with a new name.
But the real answer is that you should try to avoid redundancy in mutable data structures. Depending on your actual problem, there is a good chance that there's a better way to build your data structure, but without knowing what kind of operations you want to do with them, we can't tell.
You can also read up on normalization forms. That's a concept that's often used in the area of databases, but it (partially) applies to any mutable data structure.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Dynamic hash keys
by markdibley (Sexton) on Aug 17, 2010 at 10:33 UTC | |
by SuicideJunkie (Vicar) on Aug 17, 2010 at 13:58 UTC | |
by moritz (Cardinal) on Aug 17, 2010 at 15:10 UTC |