I forgot to include this option:

   t = stems.map { |f|
      f + "." + guess_extension(f)
   }
   all_files3 = transform2(source_files + transform1(t)).map { |f|
      File.join(dir, f)
   }

Introducing needless temporaries on the same scope level as the target
variable makes understanding and maintenance harder.  Look again:

   all_files = stems.map { |f|
      f + "." + guess_extension(f)
   }.as { |t|
      transform2(source_files + transform1(t))
   }.map { |f|
      File.join(dir, f)
   }

This clearly communicates that the purpose of the block chain is to
obtain a value for all_files.  From beginning to end, we understand
the intent at a glance.  In the former case, the intent is muddled by
a useless variable floating around.  Multiply this example by 10 and
it quickly becomes the difference between beauty and travesty.

This was my previous response (with editing) to the suggestion that I
should use Object#instance_eval instead of Object#as:

What if I want to use the "self" before the instance_eval?  What if I
use "self" inside the block while forgetting that I'm inside an
instance_eval?  I'd be screwed, and screwing would serve no purpose
except to avoid defining Object#as.

The use instance_eval communicates a specific purpose which is
entirely different from the purpose of Object#as.  I want to take the
current object, name it *as* something, perform some operations on it,
and give the result.

The current object should not be given the name "self", which is a
special name.  It should be given a temporary name (e.g. "t") which
communicates its temporal non-specialness.  Object#instance_eval is
the former, Object#as is the latter.