From: spooq Date: 2006-11-17T21:24:40+09:00 Subject: Re: #returning and #tap On 11/17/06, dblack@wobblini.net wrote: > Hi -- > > On Fri, 17 Nov 2006, spooq wrote: > > >> I don't think dup'ing plays well with the intent, which is to do a > >> kind of pass-through of the object itself. > > > > The original object -is- getting passed through... the point is to > > prevent modification of it. That's what map! and each are for. > > I see what you mean. Well, as per my gsub! example, I think modifying > it can be useful :-) This can be rewritten using existing keywords tho... if you want to actually use the original, use each and gsub!, or if you want to use the output, then use map and gsub. Doing both at the same time just means that your nice single chain of operations will either a) end up giving you the same end result as your input is now modified to be, which you have to admit is not very useful or b) somewhere else along the chain you'll stop modifying one, which is going to be hideously confusing. If the original and the output share steps, make that obvious.