Benoit Daloze wrote :

> h = {}
> [1, 2].each { |i| h[i] = 2*i }
> h
>
> I believe the code I showed is somewhat common in 1.9 and is clear to people knowing about it.

I would write
  Hash.new.tap do |h|
  ...
  end

Heavier, but the intention is clearer, and without an extra variable (outside of the block).

_md