Hi --

I see there's a change from 1.8.2 to 1.8.3, involving the superclass
of a singleton class, and I don't quite understand the way it now
works.

It seems that if you define an instance method in that class, the
object does not see it:

class C
end

c = C.new
cc = (class << c; self; end)

cc.superclass.class_eval do
   def y
     puts "superclass of singleton class"
   end
end

c.y # undefined method 'y' for c

This doesn't seem to be a real superclass relationship, since the
superclass isn't on the method lookup path of the object.  I'm not
sure what it is exactly.  It also doesn't show up in the ancestors of
the singleton class.

Can someone explain?  Or should I stop being lazy and see if it's been
changed in 1.8.4 previews? :-)


David

-- 
David A. Black
dblack / wobblini.net

"Ruby for Rails", forthcoming from Manning Publications, April 2006!