From: "alexeymuranov (Alexey Muranov)" Date: 2013-05-02T21:04:25+09:00 Subject: [ruby-core:54741] [ruby-trunk - Bug #8359] If p is a proc, p.call(x) can take a block, but p[x] cannot Issue #8359 has been updated by alexeymuranov (Alexey Muranov). =begin Ok, maybe this is not a bug report but a feature request. Is there a reason to not allow (({ p[x] do ...}))? =end ---------------------------------------- Bug #8359: If p is a proc, p.call(x) can take a block, but p[x] cannot https://bugs.ruby-lang.org/issues/8359#change-39082 Author: alexeymuranov (Alexey Muranov) Status: Rejected Priority: Normal Assignee: Category: core Target version: ruby -v: 2.0.0 Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN =begin format = lambda { |l, s = '', &w| l.map {|e| w ? w[e] : e}.join(s) } format.call([1, 2], "\n") {|c| "[ #{ c } ]"} # => "[ 1 ]\n[ 2 ]" format[[1, 2], "\n"] {|c| "[ #{ c } ]"} # => SyntaxError: unexpected { arg, expecting end-of-input =end -- http://bugs.ruby-lang.org/