From: Csaba Henk Date: 2005-12-18T05:22:32+09:00 Subject: Re: multiple blocks (unfold) On Sat, Dec 17, 2005 at 10:03:32AM +0900, mental@rydia.net wrote: > Quoting Devin Mullins : > > > Usage: > > > > a = Unfolder.stop? { |s| s > 10 }.f { |s| s * 2 }.g { |s| s + 1 > > }.unfold(0) > > > > Hey, that's not too bad. Use the named parameter idiom from Java. > > It's a little weird from a Ruby perspective, but except for being > (essentially) curried it's rather like the way you'd do it in > Smalltalk. I wrote up a small metaprogramming library back in the spring which adds this syntax to Ruby classes/modules in an (IMHO) convenient way: http://creo.hu/~csaba/ruby/multiblocks/ Csaba