From: Gary Wright Date: 2007-04-06T14:48:00+09:00 Subject: Re: about functional programming On Apr 6, 2007, at 1:15 AM, gaoxtwarrior wrote: > when it comes the method needs two block to accomplish a task,how > the ruby > do which? for example , the classical sum(filter,mapping,iterator) > (I have > forgotten the style, maybe,the one can search it in SICP) Ruby's block syntax is just a special (and very useful) case for a single block but you can construct proc objects and pass them directly if you you have a need: def merge(a,b,c) [a.call, b.call, c.call].join('/') end result = merge( proc { "first block" }, proc { "second block"}, proc { "third block" } ) puts result # "first block/second block/third block" Gary Wright