Created
February 25, 2012 14:35
-
-
Save schinen/1908781 to your computer and use it in GitHub Desktop.
script 'varargs_test.rb' result on CRuby 1.9.2
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
>ruby --version | |
ruby 1.9.2p290 (2011-07-09) [i386-mingw32] | |
>ruby varargs_test.rb | |
-------------------- | |
pass String | |
args : ["bar"] | |
args.join(', ') : bar | |
-------------------- | |
pass Strings | |
args : ["bar", "hoge"] | |
args.join(', ') : bar, hoge | |
-------------------- | |
pass Symbol | |
args : [:bar] | |
args.join(', ') : bar | |
-------------------- | |
pass Symbol | |
args : [:bar, :hoge] | |
args.join(', ') : bar, hoge | |
-------------------- | |
pass FixNum | |
args : [1] | |
args.join(', ') : 1 | |
-------------------- | |
pass FixNums | |
args : [1, 2] | |
args.join(', ') : 1, 2 | |
-------------------- | |
pass Foo class | |
args : [#<Foo:0x2a40a88>] | |
args.join(', ') : #<Foo:0x2a40a88> | |
-------------------- | |
pass Foo object and Bar object | |
args : [#<Foo:0x2a40620>, #<Bar:0x2a40608>] | |
args.join(', ') : #<Foo:0x2a40620>, #<Bar:0x2a40608> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment