From: Trans Date: 2007-04-07T21:16:11+09:00 Subject: Re: about functional programming On Apr 6, 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) You can cache one block and wait on the other, from another method, eg. foo{ block1 }.bar{ block2 } Like so: def foo(&b) @foo = b self end def bar(&b) #do stuff with @foo and b end T.