From: botp Date: 2008-01-08T13:36:19+09:00 Subject: Re: proc to block On Jan 8, 2008 12:06 PM, L A wrote: > Is there a way to turn a Proc into a block for the purposes of methods that yield to blocks? It's not a necessity as I can always wrap the Proc in a block, I'm just curious. maybe use the & op, like p=proc{"hi, i'm proc"} #=> # p.call #=> "hi, i'm proc" def q yield end #=> nil q LocalJumpError: no block given from (irb):7:in `q' from (irb):9 from :0 q &p #=> "hi, i'm proc" (proc &p).call #=> "hi, i'm proc" i am not sure why you want to wrap a proc with a block though proc {p} #=> # (proc {p}).call #=> # (proc {p}).call.call #=> "hi, i'm proc" kind regards -botp