[#6864] ruby 1.8.4 rc breaks alias_method/rails in bad ways — "Ara.T.Howard" <ara.t.howard@...>

20 messages 2005/12/09
[#6870] Re: ruby 1.8.4 rc breaks alias_method/rails in bad ways — =?ISO-8859-15?Q?Florian_Gro=DF?= <florgro@...> 2005/12/12

Ara.T.Howard wrote:

[#6872] Re: ruby 1.8.4 rc breaks alias_method/rails in bad ways — ara.t.howard@... 2005/12/12

On Tue, 13 Dec 2005, [ISO-8859-15] Florian Growrote:

[#6873] Re: ruby 1.8.4 rc breaks alias_method/rails in bad ways — James Edward Gray II <james@...> 2005/12/12

On Dec 12, 2005, at 1:19 PM, ara.t.howard@noaa.gov wrote:

[#6874] Re: ruby 1.8.4 rc breaks alias_method/rails in bad ways — ara.t.howard@... 2005/12/12

On Tue, 13 Dec 2005, James Edward Gray II wrote:

[#6891] Time.utc! and Time.localtime! — Daniel Hobe <hobe@...>

Writing a script yesterday I found out, much to my surprise, that the

16 messages 2005/12/14

[#6918] change to yaml in 1.8.4 — ara.t.howard@...

14 messages 2005/12/16

[#6934] 1.8.x, YAML, and release management — Ryan Davis <ryand-ruby@...>

I'm concerned that 1.8.3's acceptance of non-backwards-compatible

28 messages 2005/12/18

[#6996] Problems building 1.8.4 with VS8 C++ Express Edition (cl 14.00) — Austin Ziegler <halostatue@...>

Visual Studio C++ 2005 Express Edition (VS 8.0)

20 messages 2005/12/27

question about superclass of singleton class

From: dblack@...
Date: 2005-12-13 04:31:09 UTC
List: ruby-core #6885
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!

In This Thread

Prev Next