From: Simon Strandgaard Date: 2004-04-19T20:09:07+09:00 Subject: Re: convert yield to proc On Mon, 19 Apr 2004 13:51:00 +0200, Simon Strandgaard wrote: > On Mon, 19 Apr 2004 20:42:58 +0900, ts wrote: >> > > Bommer.. your right. I thought I was on to something. > > > Any idea how to do this? Just realized that my knowledge about &block is flawed! server> ruby a.rb before after before middle after server> expand -t2 a.rb def m(&block) puts "before" if block_given? block.call end puts "after" end m m do puts "middle" end server> Thanks for correcting me.. I have thought until now, that the &block was indicating the a block must be supplied. However I just realized that this is not the case, which is a pleasant surprise. Thanks every one. BTW: Now the conversion problem is wiped away ;-) -- Simon Strandgaard