From: Dave Thomas Date: 2001-03-07T01:59:42+09:00 Subject: [ruby-talk:12158] Re: (long) Re: hash.invert loses data if equal values exist - is this the right behaviour? gotoken@math.sci.hokudai.ac.jp (GOTO Kentaro) writes: > I see. But I don't know the purpose of Hash#invert. IMHO, invert is > not a so general method to be built-in... I've used it a couple of times, but I agree it's rare. As an artificial example: e_2_j = { "one" => "ichi", "two" => "ni", "three" => "san" } j_2_e = e_2_j.invert Of course this breaks down at "shi" => "four", "yon" => "four", but there are many true one-to-one mappings where .invert can be useful. Dave