Skip to content

Instantly share code, notes, and snippets.

@headius
Created April 13, 2011 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/917031 to your computer and use it in GitHub Desktop.
Save headius/917031 to your computer and use it in GitHub Desktop.
Testing fixnum monkeypatch in JRuby 1.6.1
Populating the hash:
Getting Number(20).hash() <Fixnum 20>.hash => 41
<Fixnum 20>.hash => 41
=> 41
Getting Number(21).hash() <Fixnum 21>.hash => 43
<Fixnum 21>.hash => 43
=> 43
Getting Number(22).hash() <Fixnum 22>.hash => 45
<Fixnum 22>.hash => 45
=> 45
Getting Number(23).hash() <Fixnum 23>.hash => 47
<Fixnum 23>.hash => 47
=> 47
Getting Number(24).hash() <Fixnum 24>.hash => 49
<Fixnum 24>.hash => 49
=> 49
Getting Number(25).hash() <Fixnum 25>.hash => 51
<Fixnum 25>.hash => 51
=> 51
Getting Number(26).hash() <Fixnum 26>.hash => 53
<Fixnum 26>.hash => 53
=> 53
Getting Number(27).hash() <Fixnum 27>.hash => 55
<Fixnum 27>.hash => 55
=> 55
Getting Number(28).hash() <Fixnum 28>.hash => 57
<Fixnum 28>.hash => 57
=> 57
Getting Number(29).hash() <Fixnum 29>.hash => 59
<Fixnum 29>.hash => 59
=> 59
Getting Number(30).hash() <Fixnum 30>.hash => 61
<Fixnum 30>.hash => 61
=> 61
Looking up using Integer:
<Fixnum 23>.eql?(#<Number:0x100166d30 @i=23>) => true
true
Looking up using Number.new(23):
Getting Number(23).hash() <Fixnum 23>.hash => 47
<Fixnum 23>.hash => 47
=> 47
<Number 23>.eql?(#<Number:0x100166d30 @i=23>) <Fixnum 23>.eql?(23) => true
=> true
true
Populating the hash:
Getting Number(20).hash() => 20
Getting Number(21).hash() => 21
Getting Number(22).hash() => 22
Getting Number(23).hash() => 23
Getting Number(24).hash() => 24
Getting Number(25).hash() => 25
Getting Number(26).hash() => 26
Getting Number(27).hash() => 27
Getting Number(28).hash() => 28
Getting Number(29).hash() => 29
Getting Number(30).hash() => 30
Looking up using Integer:
nil
Looking up using Number.new(23):
Getting Number(23).hash() => 23
<Number 23>.eql?(#<Number:0x57807a @i=23>) => true
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment