Issue #8359 has been reported by alexeymuranov (Alexey Muranov).

----------------------------------------
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

Author: alexeymuranov (Alexey Muranov)
Status: Open
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/