From: Gregory Marton Date: 2008-02-24T23:19:26+09:00 Subject: Re: passing method references in python & ruby Another potentially easy question: I'd like to pass a surround method into another, where the surround method would take a block, and should yield to it, perhaps doing stuff before and after. This is not a real call/cc surround, just something simple. So: def do_things(options={}) opts = {:surround => Proc.new{yield}}.merge(options) opts[:surround] do the actual task end end except this doesn't actually work with Procs, because opts[:surround] is an undefined method, of course. It contains a method reference. Well, rather, a procedure reference. In any case, I want to invoke it with a block. so I think y = lambda{ yield } y.call{ 3 } perhaps, but no: LocalJumpError: no block given How shall I pass it a block? Thanks, Grem -- Posted via http://www.ruby-forum.com/.