From: furtive.clown@... Date: 2007-11-13T05:40:01+09:00 Subject: Re: alias_method :tap, :affect On Nov 12, 2:31 pm, Martin DeMello wrote: > On Nov 12, 2007 11:10 AM, wrote: > > > > > This is the first I've heard of Object#tap. It seems backward because > > you almost always want the result of the block, not the object back > > again. > > #tap is the opposite use case - you want to "tap" the object stream, > observing without affecting. OK I understand Object#tap now. At first I thought the motivation was to modify the object inside the block, but now I see that it can be a useful part of functional-style ruby. So, to throw this out again --- there should also be Object#as which returns the block result (I like the name 'as' but I am not particularly attached to it). I can personally attest to its usefulness, and I can show reams of examples in addition to the above one I gave.