From: David Alan Black Date: 2001-12-31T13:29:23+09:00 Subject: [ruby-talk:29802] Re: Proc.class vs yield Hi -- On Mon, 31 Dec 2001, Michael Lucas-Smith wrote: > > > > > >So typically you'd see: > > > > def my_method(arg1, arg2, &block) > > ... > > end > > > >I'm not sure what you want to do in your example.... What are you > >expecting &a and &b to be? > > > Two proc's. It seems that I can't pass two procs to a method unless the > calling method is horribly ugly. Passing Proc objects is inherently no uglier than passing any other kind: pr1 = proc { |x| puts "My arg is #{x}" } pr2 = proc { |x| puts "My arg * 2 is #{x * 2}" } some_method(pr1,pr2) Neither of those procs, though, is the method call's block. You'd have to specify that too, if you want to use one: some_method(pr1,pr2) { puts "This is the supplied block." } David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav