From: Julian Raschke Date: 2011-06-17T09:49:11+09:00 Subject: [ruby-core:37191] [Ruby 1.9 - Bug #4561] 1.9.2 requires parentheses around argument of method call in an array, where 1.8.7 did not Issue #4561 has been updated by Julian Raschke. Yukihiro Matsumoto wrote: > It's an intentional syntax change in 1.9. I have run into the same issue today and wasn't sure if it was a bug or intentional. Glad I found your note here! Out of curiosity, what is the reasoning behind this breaking change? It seems a bit unintuitive that foo(bar 5) works, but [bar 5] not, and both are enclosed calls without parenthesis. Is there an ambiguity nearby that I am missing? ---------------------------------------- Bug #4561: 1.9.2 requires parentheses around argument of method call in an array, where 1.8.7 did not http://redmine.ruby-lang.org/issues/4561 Author: Dave Schweisguth Status: Assigned Priority: Normal Assignee: Yukihiro Matsumoto Category: core Target version: ruby -v: - =begin [dave hladik:~] cat method_call_without_parens_in_array.rb def method_name(arg) end [ method_name 'value' ] [dave hladik:~] ruby -v ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10] [dave hladik:~] ruby method_call_without_parens_in_array.rb [dave hladik:~] rvm 1.9.2 [dave hladik:~] ruby -v ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0] [dave hladik:~] ruby method_call_without_parens_in_array.rb method_call_without_parens_in_array.rb:4: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' [ method_name 'value' ] ^ method_call_without_parens_in_array.rb:4: syntax error, unexpected ']', expecting $end [dave hladik:~] rvm system [dave hladik:~] ruby -v ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10] [dave hladik:~] cat method_call_with_parens_in_array.rb def method_name(arg) end [ method_name('value') ] [dave hladik:~] ruby -v ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10] [dave hladik:~] ruby method_call_with_parens_in_array.rb [dave hladik:~] rvm 1.9.2 [dave hladik:~] ruby -v ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0] [dave hladik:~] ruby method_call_with_parens_in_array.rb # no error =end -- http://redmine.ruby-lang.org