Jim Freeze schrieb:

> I'm not sure I understand your point here.
>
>A typical use is below:
>
>  irb(main):001:0> module M
>  irb(main):002:1> def fred; "fred"; end
>  irb(main):003:1> end
>  => nil
>  irb(main):004:0> class C; end
>  => nil
>  irb(main):005:0> c = C.new
>  => #<C:0x46b10>
>  irb(main):006:0> c.extend M
>  => #<C:0x46b10>
>  irb(main):007:0> c.fred
>  => "fred"
>  irb(main):008:0> c = c.dup
>  => #<C:0x871d8>
>  irb(main):009:0> c.fred
>  NoMethodError: undefined method `fred' for #<C:0x871d8>
>          from (irb):9
>          from :0
>
>But, if you have module methods and extended an object,
>what would be the point? How do module methods show up
>in extended objects? I thought they didn't.
>  
>
Cloning a Module object and cloning an object that
was extend by Module is very different and cloning
a Class object is jet another subject - speaking of which

The following abuse creates an unprintable Class object


---
class O
end

P = class << O; self end.dup

class << P
    p superclass
rescue SystemStackError => mes
  puts  mes  # stack level too deep
end
---


/Christoph