From: "alexeymuranov (Alexey Muranov)" Date: 2013-11-08T05:05:01+09:00 Subject: [ruby-core:58230] [ruby-trunk - Feature #9095] Allow `Symbol#to_proc` to take arguments Issue #9095 has been updated by alexeymuranov (Alexey Muranov). Some prefer to do everything without variables, this is a matter of taste. I am not sure there is no better way to obtain the same pros without using literal blocks, this was the first thing that came to my mind. ---------------------------------------- Feature #9095: Allow `Symbol#to_proc` to take arguments https://bugs.ruby-lang.org/issues/9095#change-42811 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/