Created
April 13, 2011 05:49
-
-
Save headius/917031 to your computer and use it in GitHub Desktop.
Testing fixnum monkeypatch in JRuby 1.6.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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