From: Robert Dober Date: 2006-10-02T19:31:17+09:00 Subject: Re: Why can't I get on Top? ------=_Part_43726_30921573.1159785074415 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/2/06, dblack@wobblini.net wrote: > > Hi -- > > > class C; end > class D < C; end > > d = D.new > sing = class << d; self; end > > p D.new.instance_of?(C) # false > p D.new.instance_of?(D) # true > p D.new.instance_of?(sing) # false > > So thinking of the singleton class as a subclass of the object's class > might be a little misleading, since the object still relates to its > "birth class" at only one level of remove. Of course, but what I am puzzeled about is, why you use #instance_of?, well not really, because that was how the argument began. As a matter of fact let me be more humble ;) I am afraid I missed something basic in the discussion, because to my understanding #instance_of? is irrelevant and #is_a? is what we are interested in, no? (obviously no ;). Thx Robert > David > > -- > David A. Black | dblack@wobblini.net > Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] > DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] > [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com > [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org > > ------=_Part_43726_30921573.1159785074415--