From: gotoken@... (GOTO Kentaro) Date: 2001-03-07T05:45:15+09:00 Subject: [ruby-talk:12177] Re: (long) Re: hash.invert loses data if equal values exist - is this the right behaviour? In message "[ruby-talk:12158] Re: (long) Re: hash.invert loses data if equal values exist - is this the right behaviour?" on 01/03/07, Dave Thomas writes: >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. Yes, it could be useful sometime. Thank you. But I feel a little danger because Hash does not have any checking mechanism to detect multiple values. At least it should be documented in the reference manual. -- Gotoken