jim
9/19/2008 10:40:00 PM
How can get Ruby to tell me when I'm overwriting an existing key in my
hash?
For example,
h = { "key1" => [6, 44, 12],
"key2" => [8, 1],
.
.
}
The hash could get big enough where I accidentally add a new entry,
"key1" => [99, 3]
when what I needed to do was add [99, 3] to key1's array. I won't get
any warning that the first occurrence of key1 is being replaced.