On 2/16/07, ara.t.howard / noaa.gov <ara.t.howard / noaa.gov> wrote:

> why not
>
>    harp:~ > cat a.rb
>    class Object
>      def tap &b
>        instance_eval &b
>        return self
>      end
>    end
>
>    puts "foobar".tap{ gsub! /bar/, '' }  #=> foo

Well that prevents you from being able to access the enclosing scope,
but maybe that's okay for a tap.  You could always offer both by
checking block arity.