Created
February 14, 2011 16:54
-
-
Save qrush/826147 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
ruby % rvm use 1.9.2 | |
Using /Users/qrush/.rvm/gems/ruby-1.9.2-p136 | |
ruby % irb | |
ruby-1.9.2-p136 :001 > a = [] | |
=> [] | |
ruby-1.9.2-p136 :002 > a.push(3,) | |
=> [3] | |
ruby % rvm use ree | |
Using /Users/qrush/.rvm/gems/ree-1.8.7-2010.02 | |
ruby % irb | |
ree-1.8.7-2010.02 :001 > a = [] | |
=> [] | |
ree-1.8.7-2010.02 :002 > a.push(3,) | |
SyntaxError: compile error | |
(irb):2: syntax error, unexpected ')' | |
from (irb):2 | |
from :0 |
This has always worked for arrays ([3,]
). Ruby 1.9 just extends it to parameter lists.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hm, this works the same
a.push 3,
=> [3, [...]]