Hi, 

In message "[ruby-talk:00548] Bug: concerning Modules!"
    on 99/08/03, clemens.hintze / alcatel.de <clemens.hintze / alcatel.de> writes:
>def object(&blk)
>    foo = ::Module.new
>    foo.extend(Foo)
>    foo.module_eval &blk if blk
>    obj = foo.clone               # (1) Cause crash if blk.nil?
>    obj.extend(foo)
>    obj
>end

I found very similar code written by Yoshinori Toki:
http://www.freedom.ne.jp/toki/ruby/anonymous.rb

(From that's comment)

  anon = Anonymous.new{ |obj|
    def obj.hello
      "Hello world."
    end
  }
  p anon.hello

  hello = Anonymous.new(String, "Hello world.") { |obj|
    def obj.print
      p self
    end
  }
  hello.print


-- gotoken