From: "charliesome (Charlie Somerville)" Date: 2013-11-08T04:59:07+09:00 Subject: [ruby-core:58228] [ruby-trunk - Feature #9095] Allow `Symbol#to_proc` to take arguments Issue #9095 has been updated by charliesome (Charlie Somerville). Is there any real benefit to using something like: &:foo.to_proc(bar) instead of: { |x| x.foo(bar) } Personally I find the first form to be quite ugly and difficult to understand at first glance. ---------------------------------------- Feature #9095: Allow `Symbol#to_proc` to take arguments https://bugs.ruby-lang.org/issues/9095#change-42810 Author: alexeymuranov (Alexey Muranov) Status: Open Priority: Normal Assignee: Category: Target version: =begin After discussing #9076, i've decided to propose this: class Symbol def to_proc(*args) proc do |x| x.public_send(self, *args) end end end p = :+.to_proc(1) p[2] # => 3 [1, 2, 3, 4].map &:to_s.to_proc(2) #=> ["1", "10", "11", "100"] This would allow constructing more kinds of procs without using literal blocks. =end -- http://bugs.ruby-lang.org/