From: Roger Johansson Date: 2006-06-24T08:04:09+09:00 Subject: Re: class << self? Ok, thanks I think im sort of getting the picture now :-P "MyType" is an instance of class "Class". this instance has a metaclass , which holds the static methods for MyType. eg in pseudo c#ish code: RubyClass MyType = new RubyClass(); MyType.Meta = new RubyMetaClass(); MyType.Meta.StaticMethods.Add("some_method",args); would that be a correct view of the object/class relations in this case? this seems fair enough but what I dont get is why are static methods and instance methods stored in different places? in other languages(or rather implementations of languages) instance methods are just syntax sugar for a static method with a "this" pointer as the first arg. but they are still stored at the same palce. what I dont get is why I only need to do the "class << self" thing when aliasing static methods and not instance methods. Why are the instance methods accessable in the context of MyType ? ...hmmm.. maybe I get it now .. the meta class is a runtime class which has the actual static methods as real methods , not just a list of methods as in my pseudo sample? it would be more like: RubyClass MyType = new RubyClass(); MyType.Meta = new ConcreteMetaClassForMyType(); //<-- and every call to a static method is just directed to the meta class? and since MyType is not only an instance of Class , it is also a "class", so MyType is a class that has the instance methods. and the meta has the static methods of MyType as instance methods? or should I go to sleep now? this is weird :-P //Roger -- Posted via http://www.ruby-forum.com/.