Created
July 17, 2010 05:48
-
-
Save takkanm/479276 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
1.8と1.9でstack level too deepのでるタイミングも違う | |
>> RUBY_VERSION | |
=> "1.8.7" | |
>> class Fixnum | |
>> def add_one(o) | |
>> self + o + 1 | |
>> end | |
>> end | |
=> nil | |
>> 1 + 1 | |
=> 2 | |
>> class Fixnum | |
>> def add_one(o) | |
>> self + o + 1 | |
>> end | |
>> alias_method "+", "add_one" | |
>> end | |
=> Fixnum | |
>> 1 + 1 | |
(irb):10:in `+': stack level too deep (SystemStackError) | |
from (irb):10:in `+' | |
ruby-head > RUBY_VERSION | |
=> "1.9.3" | |
ruby-head > class Fixnum | |
ruby-head ?> def add_one(o) | |
ruby-head ?> self + o + 1 | |
ruby-head ?> end | |
ruby-head ?> alias_method "+", "add_one" | |
ruby-head ?> end | |
=> Fixnum | |
(irb):9: stack level too deep (SystemStackError) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment