gwtmp01 wrote: >> >> extend_class( Myclass ) >> x = Myclass_extension.new >> x.new_method1 >> y = Myclass_extension.new >> y.new_method1 > > I'm not sure what you are getting at here. > > Myclass.class is the particular object Class. Because > all class objects are instances of Class. > > #{some_class.class}_extension > > ends up being the string > > Class_extension > > because Class.to_s is the string 'Class'. > Oops. It should have been #{some_class}. The whole point of that was so that I could have code that writes code (dynamically) based on states of other parts of the program (I think it is also known as metaprogramming). Of course, with that simple example I posted, it wouldn't make much sense. It seems like this sort of thing would be very useful for artificial intelligence (i.e., learning). On the class singleton example you posted: that's very neat. Now, I think my understanding of these sort of singletons is complete. :) --J -- Posted via http://www.ruby-forum.com/.