From: spooq Date: 2006-11-09T01:23:58+09:00 Subject: Re: #returning and #tap Just realised that of course tap != k :P On 11/8/06, Trans wrote: > > James Edward Gray II wrote: > > On Nov 8, 2006, at 8:40 AM, Trans wrote: > > > > > Had use for this today: #returning is a convenience method you'll find > > > in both Facets and ActiveSupport. Jamis' blogged it the other day: > > > > > > > > > http://weblog.jamisbuck.org/2006/10/27/mining-activesupport-object- > > > returning > > > > > > Any one else think this is worthy of standard Ruby? > > > > > > Also, a cool twist on the same concept is #tap. Check out the > > > MenTaLgeniuS: > > > > > > > > > http://moonbase.rydia.net/mental/blog/programming/eavesdropping-on- > > > expressions.html > > > > One of the comments to the original article combines both methods > > into a with() method that seems to be the best of both worlds. > > Oh yea! I remember #with from way back, but then I don't recall anyone > suggesting it return the object. Cool. > > One thing though, while it covers #tap just fine, it doesn't read the > same as #returning. > > T. > > >