----- Original Message ----- 
From: "you CAN teach an old dog ..." <itsme213 / hotmail.com>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Friday, June 06, 2003 11:08 PM
Subject: multiple blocks or proc arguments to method


> I was trying to write a collect_if method:
> 
> Array#collect_if ( &predicate, &collector )
> 
> It would include collector(y) in the result iff predicate(y) was true.
> 
> I could not figure out a way of having two named block or proc
> arguments to a method. What am I missing? A different metaphor?

This should work, but the calling syntax 
only permits one block to be passed as an
explicit block.

Try calling it something like this:

   obj.collect_if(proc {...}) { ... }

Should work.

Hal