From: ts Date: 2002-12-14T19:45:03+09:00 Subject: Re: Inheritance Question >>>>> "a" == ahoward writes: a> p ((mm + Matrix[[12]]).type) # >> MyMatrix a> p ((Matrix[[12]] + mm).type) # >> Matrix a> p ((mm + mm).type ) # >> MyMatrix Now you have a big problem, because this not what ruby do pigeon% cat b.rb #!/usr/bin/ruby class A < Array; end a = A.new p ((a+[]).class) p (([]+a).class) p ((a+a).class) pigeon% pigeon% b.rb Array Array Array pigeon% a> this is exactly what i was refering to : a> all references to 'Matrix.method' from INSIDE instance methods need to a> bechanged to 'type.method' and all is well... you have written a class which break completely the way that ruby work, and all persons will be surprised by your strange class. a> course *not*. if one realizes the Object + AnOther is really a> Object.+(AnOther) is makes perfect sense. it make perfect sense in *your* language, but this language *is NOT* ruby. Guy Decoux