Created
December 20, 2010 18:46
-
-
Save krekoten/748801 to your computer and use it in GitHub Desktop.
Very interesting ruby 1.9 behavior
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
| # Ruby 1.9.2 | |
| ruby-1.9.2-p0 > class O; end | |
| nil | |
| ruby-1.9.2-p0 > O.new(1,2,3) | |
| #<O:0x00000100a9fcf8> | |
| # Ruby 1.8.7 | |
| irb(main):001:0> class O; end | |
| nil | |
| irb(main):002:0> O.new(1,2,3) | |
| ArgumentError: wrong number of arguments (3 for 0) | |
| from (irb):2:in `initialize' | |
| from (irb):2:in `new' | |
| from (irb):2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment