E
Eyal Oren
Hi,
say one = {:a=>:b}
then one.hash != one.clone.hash
is that a bug or correct?
(using ruby 1.8.4 (2005-12-24) [i486-linux])
second question:I want to index use a hash as key in a hashtable, but
it doesnt work (probably because of above problem)
one = {:a=>:b}
two = {:a=>:b}
test[one] = 1
test[two] .. nil
test.include? one .. true
test.include? two .. false
although one == two .. true
on the other hand, one.eql?(two) .. false (which seems wrong to me, as
matz indicated in 2004, see
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/122510)
and also one.hash != two.hash (as pointed out above, and seems to be
the source of the problem)
so it seems:
- hash.eql? is wrong (see matz' earlier message)
- hash.hash is wrong (try it with dup of itself)
or do i miss something?
say one = {:a=>:b}
then one.hash != one.clone.hash
is that a bug or correct?
(using ruby 1.8.4 (2005-12-24) [i486-linux])
second question:I want to index use a hash as key in a hashtable, but
it doesnt work (probably because of above problem)
one = {:a=>:b}
two = {:a=>:b}
test[one] = 1
test[two] .. nil
test.include? one .. true
test.include? two .. false
although one == two .. true
on the other hand, one.eql?(two) .. false (which seems wrong to me, as
matz indicated in 2004, see
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/122510)
and also one.hash != two.hash (as pointed out above, and seems to be
the source of the problem)
so it seems:
- hash.eql? is wrong (see matz' earlier message)
- hash.hash is wrong (try it with dup of itself)
or do i miss something?