From: Christoph Rippel Date: 2001-04-05T15:46:11+09:00 Subject: [ruby-talk:13504] Singleton bugs? Hi, is this a bug? - If not can somebody explain this to me (cygwin 1.7 (4-03) ) ----------- def change_all(bla) class << bla def peak; K end end end class A; end class B; end Ma = \ class << (a = A.new) K = "A" self end Mb = \ class << (b = B.new) K = "B" self end change_all(a) change_all(b) p a.peak # => "B" p b.peak # => "B" change_all(a) p a.peak # => "A" p b.peak # => "A" p a.instance_eval { K } # => "A" p b.instance_eval { K } # => "B" p Ma::K # = > "A" p Mb::K # => "B" Christoph