From: dblack@... Date: 2006-11-17T20:01:57+09:00 Subject: Re: #returning and #tap Hi -- On Fri, 17 Nov 2006, Martin DeMello wrote: > On 11/17/06, dblack@wobblini.net wrote: >> >> Part of what's odd to me about #then is that it's not >> constructor-specific. Once it's defined you could do: >> >> x = string.split(',').then do |array| >> array.map! { something } >> end > > "then" actually works fine for me there, Englishwise. Maybe and_then > would read slightly better: > > string.split(',').and_then do |array| I wonder if there's some name that embodies the fact that the object is going to come back from this method call. The temporal ones (then, and_then, etc.) sound kind of self-evident ("Well, of course the next thing happens 'then'," my brain says). Perhaps that was the reasoning behind "tap", though "tap" doesn't communicate much to me. I'm not sure. David -- David A. Black | dblack@rubypal.com Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org