From: Joel VanderWerf Date: 2009-04-28T08:47:42+09:00 Subject: Re: Block Style Sean O'Halpin wrote: > On Mon, Apr 27, 2009 at 6:07 PM, Joel VanderWerf > wrote: >> Sean O'Halpin wrote: >>> In your first example, it would appear that you ~are~ concerned with >>> the return value of the block as you call #whatever on it, so I'd use: >>> >>> arr.sort.tap { |sorted| >>> p sorted >>> }.whatever� >> Actually, the return value of #tap is different from the return value of the >> block (which is ignored by tap, IIRC). That puzzled me for a moment. >> >> -- >> vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 >> > > You're right - sloppy wording on my part. But you were only puzzled > for a moment, right? ;) No, I'm puzzled most of the time :) Does it make a difference, in choosing between foo {..}.bar and foo do..end.bar whether the value is the block value or the #foo return value (in those cases where they differ)? Probably not, just a thought... -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407