From: "Hal E. Fulton" Date: 2003-06-07T13:25:54+09:00 Subject: Re: multiple blocks or proc arguments to method ----- Original Message ----- From: "you CAN teach an old dog ..." Newsgroups: comp.lang.ruby To: "ruby-talk ML" 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