From: "rosenfeld (Rodrigo Rosenfeld Rosas)" Date: 2012-12-05T19:47:36+09:00 Subject: [ruby-core:50568] [ruby-trunk - Feature #6284] Add composition for procs Issue #6284 has been updated by rosenfeld (Rodrigo Rosenfeld Rosas). I play a 7-string guitar and I can tell you that the extra string greatly improves our possibilities and it is pretty common in Samba and Choro Brazilian music styles: http://www.youtube.com/watch?v=3mTdpRY6yMI http://www.youtube.com/watch?v=_FNDXcVr1Pk (here we not only have a 7-string guitar but also a 10-string bandolim while the usual one has 8 strings) I'm not against #*. I just slightly prefer "<-" over "*". ---------------------------------------- Feature #6284: Add composition for procs https://bugs.ruby-lang.org/issues/6284#change-34407 Author: pabloh (Pablo Herrero) Status: Feedback Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: Target version: next minor =begin It would be nice to be able to compose procs like functions in functional programming languages: to_camel = :capitalize.to_proc add_header = ->val {"Title: " + val} format_as_title = add_header << to_camel << :strip instead of: format_as_title = lambda {|val| "Title: " + val.strip.capitalize } It's pretty easy to implement in pure ruby: class Proc def << block proc { |*args| self.call( block.to_proc.call(*args) ) } end end =end -- http://bugs.ruby-lang.org/