On Wed, 4 May 2005, Ara.T.Howard wrote:

>
> this is very useful for meta-programming:
>
>  jib:~/eg/ruby > cat a.rb
>  class Object
>    def inside_metaclass?
>      klass = Class === self ? self : self.class
>      obj_meta = class << Object; self; end
>      klass.ancestors.include? obj_meta
>    end
>  end
>
>  p inside_metaclass?
>
> i believe the implementaion is correct iff the following statement is true:
>
>  all meta-classes descend from the meta-class of Object.

I fear the terminology issue raises its head here.  Is there any
reason not to use the customary "singleton class", pending some
pronouncement from Matz that it's no longer the right term?


David

-- 
David A. Black
dblack / wobblini.net