[Newbies] How to access a Squeak class

David Mitchell david.mitchell at gmail.com
Tue Jan 16 19:22:48 UTC 2007


Doh! Sorry, didn't read carefully (or the whole thread).

Bert is right:
Smalltalk classNamed: 'Object'

On 1/16/07, David Mitchell <david.mitchell at gmail.com> wrote:
> The method Object>>#class does what you want. Since it is defined on
> Object you can send the message to any object, including a string.
>
> > returnSuperClass: aClassName
> > |aSuperClass|
> >
> > aSuperClass := (Smalltalk classNamed: aClassName) superclass.
> >
> > ^ aSuperClass.
> >
>
And now the one liner:
^(Smalltalk classNamed: aClassName) superclass.


More information about the Beginners mailing list