From: Simon Strandgaard Date: 2004-04-19T19:59:07+09:00 Subject: Re: convert yield to proc On Mon, 19 Apr 2004 20:42:58 +0900, ts wrote: >>>>> "S" == Simon Strandgaard writes: > > S> My code can take an optional block. Your above code > S> must be supplied a block. > > What do you call an optional block ? I was hoping that I had made a method which could take an optional block.. ala def m if block_given? yield end end I wanted to convert that yield into a block, which I could pass further around (as a block). [snip] > mode2 > svg% > > svg% b.rb > /b.rb:14:in `new': tried to create Proc object without a block (ArgumentError) > from ./b.rb:14:in `mode2' > from ./b.rb:17 > svg% > Bommer.. your right. I thought I was on to something. Any idea how to do this? -- Simon Strandgaard