From: Jenda Krynicky Date: 2007-06-12T21:54:38+09:00 Subject: Re: Passing block to Proc#call Chris Carter wrote: > On 6/10/07, Erwin Abbott wrote: >> puts words.last # output: thre >> >> > > class Proc > def bcall(*args,&block) > self.call(*args.concat([*block])) > end > end > > x_y = lambda {|data,proc| proc.call(data) if data.is_a? String } > > x_y.bcall("hello") {|data| puts data.succ } > > It's a hack, but it works. Interesting how an ill-designed syntactic sugar forces people to jump through the hoops. Jenda -- Posted via http://www.ruby-forum.com/.