h = {
‘foo’ => ‘abc’,
‘foo’ => ‘xyz’,
‘foo’ => 42
}
p h
I can’t think of a case where I would seriously want to do this. This
code runs cleanly on Ruby 1.6.7 and 1.7.2.
Paul
h = {
‘foo’ => ‘abc’,
‘foo’ => ‘xyz’,
‘foo’ => 42
}
p h
I can’t think of a case where I would seriously want to do this. This
code runs cleanly on Ruby 1.6.7 and 1.7.2.
Paul
I suppose ruby can distinguish the difference between the above and:
h = { ‘foo’ => ‘abc’}
h = { ‘foo’ => ‘xyz’}
h = { ‘foo’ => 42}
or
h = {}
h[‘foo’] = 'abc’
h[‘foo’] = 'xyz’
h[‘foo’] = 42
The latter two should not return a warning, but I can imagine
where it would be nice for the first to.
On Wednesday, 13 November 2002 at 2:29:38 +0900, Paul Brannan wrote:
h = {
‘foo’ => ‘abc’,
‘foo’ => ‘xyz’,
‘foo’ => 42
}
p h
Indifference will be the downfall of mankind, but who cares?