【发布时间】:2012-08-29 06:26:48
【问题描述】:
# pry / irb example #1
"abc".hash
=> -1883761119486508070
"abc".hash
=> -1883761119486508070
# pry / irb example #2
"abc".hash
=> -4309321811150053495
"abc".hash
=> -4309321811150053495
hash 值对于特定调用是恒定的,但会因调用而异。为什么?这是设计使然吗?这算不算“好事”?
我正在运行ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.0.0]。
【问题讨论】: