From: Brad Hilton Date: 2001-03-31T02:50:16+09:00 Subject: [ruby-talk:13357] passing blocks to Proc objects Hello, I am having trouble finding the syntax to pass a block of code to a Proc object. I have some code which I am almost sure was working, but I recently noticed it didn't work. This simple code illustrates my problem: proc = Proc.new { yield } proc.call { puts 'in block' } gives me the error: LocalJumpError: yield called out of block (irb):1:in `irb_binding' (irb):1:in `call' (irb):2:in `irb_binding' irb(main):003:0> ---------------------- I can work around the problem by passing the code as an argument to the Proc object, but the block syntax really appeals to me. Am I missing something here? Thanks, -Brad