--mimepart_4d3feaefbc9ca_1dc2ae9db76188df
Content-Type: text/plain
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline

Issue #4323 has been updated by Run Paint Run Run.

File proc-hash.patch added

> I'm not so sure I'd expect Proc#hash to be equal in these cases. Of course, I don't feel like rocs that simply have the same code and closure should be expected to be eql? either.

Perhaps, but the Rdoc is clear that the current behaviour of #eql? is intended, and that of #hash is wrong. If you want the spec changed, thus breaking backward compatibility, that's another discussion.

I've attached my best effort at a fix. It doesn't work for Method#to_procases because #eql? doesn't, either. With the patch applied:

    run@desktop:~/mir/ruby$   ./ruby --disable-gems -e 'r=/#{1+2}/; p ->{:FOO; r}.hash; p ->{:FOO; r}.hash'
    661952060
    661952060
    run@desktop:~/mir/ruby$  вк  ./ruby --disable-gems -e 'r=/#{1+2}/; p ->{:FOO; r}.hash; p ->{:FOO; r; 22}.hash'
    -522099608
    77097371
----------------------------------------
http://redmine.ruby-lang.org/issues/show/4323

----------------------------------------
http://redmine.ruby-lang.org

--mimepart_4d3feaefbc9ca_1dc2ae9db76188df
Content-Type: text/x-patch; name=proc-hash.patch
Content-Transfer-Encoding: Base64
Content-Disposition: attachment; filename=proc-hash.patch

ZGlmZiAtLWdpdCBhL3Byb2MuYyBiL3Byb2MuYwppbmRleCAxOGM3MzkzLi4y
M2E1ZjlhIDEwMDY0NAotLS0gYS9wcm9jLmMKKysrIGIvcHJvYy5jCkBAIC03
OTEsOCArNzkxLDE2IEBAIHByb2NfaGFzaChWQUxVRSBzZWxmKQogewogICAg
IHN0X2luZGV4X3QgaGFzaDsKICAgICByYl9wcm9jX3QgKnByb2M7CisgICAg
cmJfaXNlcV90ICppc2VxOworCiAgICAgR2V0UHJvY1B0cihzZWxmLCBwcm9j
KTsKLSAgICBoYXNoID0gcmJfaGFzaF9zdGFydCgoc3RfaW5kZXhfdClwcm9j
LT5ibG9jay5pc2VxKTsKKworICAgIGlmIChSVUJZX1ZNX05PUk1BTF9JU0VR
X1AoaXNlcSA9IHByb2MtPmJsb2NrLmlzZXEpKQorCWhhc2ggPSByYl9tZW1o
YXNoKGlzZXEtPmlzZXEsIGlzZXEtPmlzZXFfc2l6ZSAqIHNpemVvZihWQUxV
RSkpOworICAgIGVsc2UKKwloYXNoID0gKHN0X2luZGV4X3QpcHJvYy0+Ymxv
Y2suaXNlcTsKKworICAgIGhhc2ggPSByYl9oYXNoX3N0YXJ0KGhhc2gpOwog
ICAgIGhhc2ggPSByYl9oYXNoX3VpbnQoaGFzaCwgKHN0X2luZGV4X3QpcHJv
Yy0+ZW52dmFsKTsKICAgICBoYXNoID0gcmJfaGFzaF91aW50KGhhc2gsIChz
dF9pbmRleF90KXByb2MtPmJsb2NrLmxmcCA+PiAxNik7CiAgICAgaGFzaCA9
IHJiX2hhc2hfZW5kKGhhc2gpOwo-mimepart_4d3feaefbc9ca_1dc2ae9db76188df--