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/