简体   繁体   中英

How to get name of superclass according to class in smalltalk

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 )?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM