1

I know how to get a metaclass of a class in SMALLTALK (with class message ).

But how do i get the SuperClass of a class (or get the SuperClass of an instance of some class )?

2Big2BeSmall
  • 1,348
  • 3
  • 20
  • 40

1 Answers1

5

Using instance class superclass , of course! Every class can answer its (unique) superclass.

However, note that you have several capitalization mistakes that are not innocent. In Smalltalk, capitalization rules are meaningful, beyond case-sensitivity.

Also, it is uncommon to cross the instance-class level to query something like this. Usually, only meta-programming tools (debuggers, inspectors) have questions like this.

Carlos E. Ferro
  • 930
  • 10
  • 21
  • 3
    So, the bottom-line answer is you can ask a `Class` instance which its `superclass` is. You first get your `Class` instance by sending `class` to your instance, and then send `superclass` to it's response. – mgarciaisaia Jun 22 '15 at 17:48