From: Daniel Martin Date: 2007-01-25T11:29:55+09:00 Subject: Re: can it be shorter? Vincent Fourmond writes: > Actually, I've got shorter ;-): > > h = {} > for k,v in hash > [*k].each {|l| h[l] = v} > end > hash = h Well, if we're golfing: h={};hash.map{|k,v|[*k].map{|t|h[t]=v}};h -- s=%q( Daniel Martin -- martin@snowplow.org puts "s=%q(#{s})",s.map{|i|i}[1] ) puts "s=%q(#{s})",s.map{|i|i}[1]