From: mhm26@... (matt) Date: 2004-08-06T04:21:31+09:00 Subject: procs/blocks - blocks with procs, blocks with blocks? Well, maybe not blocks with blocks but blocks with yield? although right now, I only have a fix for procs with blocks and not blocks with blocks via blocks with yield when a proc block is not in stock... class Proc alias __proc_block_call call alias __proc_block_indexer [] def call(*args, &block) __proc_block_call(*(block.nil? ? args : args << block)) end def [](*args, &block) __proc_block_indexer(*(block.nil? ? args : args << block)) end end ----- usage prc = Proc.new {|arg, proc_block| p arg proc_block[arg] } prc.call("Foo") {|*what| puts "Got #{what.length} whats -- #{what.inspect}" } produces: "Foo" Got 1 whats -- ["Foo"] - also - it looks like the indexer function cannot take a block (parse error) - why?