From: furtive.clown@... Date: 2007-11-13T15:40:01+09:00 Subject: Yielding an object and caring about the result: the cousin of Object#tap The idea of Object#tap is to insert a "listener" (like tapping a phone line) into the object chain without affecting the object (without being caught eavesdropping). On the other hand, we often wish to transform the current object. I use Object#as like this: take the current object, name it *as* something, do something with it, and give the result. class Object def as yield self end end Compare: all_files2 = transform2(source_files + transform1( stems.map { |f| f + "." + guess_extension(f) })).map { |f| File.join(dir, f) } with: all_files = stems.map { |f| f + "." + guess_extension(f) }.as { |t| transform2(source_files + transform1(t)) }.map { |f| File.join(dir, f) } The former is so disheveled that I don't even know how to indent it. On the other hand, the latter is beautiful (to me). Incidentally I'm all for renaming Object#as to whatever you wish. I chose it because it expresses the intent: name the object *as* something. --FC