Why doesn’t Regex#hash behave like String#hash?
irb(main):009:0> “a”.hash
100
irb(main):010:0> “a”.hash
100
irb(main):011:0> /a/.hash
537976558
irb(main):012:0> /a/.hash
537970778
And yet…
irb(main):013:0> /a/ == /a/
true
Regexes seem pretty immutable to me, or more so than strings anyway, so
it seems resonable to hash based on whatever Regex#== looks at, rather
than use #id as the hash val.