From: Brian Candler Date: 2008-11-05T05:07:28+09:00 Subject: Re: Passing a block to a block William James wrote: > foo = proc{|x| puts x } > ==># > bar = proc{|x,prc| prc[x] } > ==># > bar[ 88, foo ] Indeed, there's no problem when you pass them around and invoke them explicitly. My question (and I apologise if I didn't word it clearly) was regarding the 'yield' keyword, to make a callback to a hidden proc which is not one of the explicit arguments. e.g. def foo(*a,&b) yield 123 # similar to b.call(123) end pr = Proc.new { |x| puts x } foo(&pr) This works fine as shown when passing to a method, but not when passing to another Proc. -- Posted via http://www.ruby-forum.com/.