From: nobu.nokada@... Date: 2004-07-08T21:50:30+09:00 Subject: Re: Proposal for Hash#invert Hi, At Thu, 8 Jul 2004 21:42:34 +0900, Han Holl wrote in [ruby-talk:105571]: > You can call this with something like: > hash.invert {|x| x.find {|el| fields.include?(el)} || > x.sort_by{|el| el.size}[-1] } > > or even the simple: > hash.invert { raise 'This hash is not invertible' } > > Does this sound generally useful, or is it just me ? Sounds good, but the block can't get the key? -- Nobu Nakada