Class Name

Yar Hwee Boon hboon at motionobj.com
Tue May 24 13:21:15 UTC 2005


On 24-May-05, at PM 07:51, BELEM Mahamadou wrote:

> Hello
>
> 1) It is possible to call a methode of a class by using a string?
>
> Example : myString := 'car'.  /where car is a class name.
>
> I want by using myString, call the "run" methode of a object of car : 
> myString run.

myCar := Car new.
myCar perform: #run

> 2) How to get the class name of a object? I try myObject className, 
> but it doesn't perform.

This looks right actually. For eg.

1 className  "answers  'SmallInteger'"

You can try reading the books found at Stéphane Ducasse's site and the 
earlier tip regarding Method Finder.

--
HweeBoon
MotionObj
(65) 6764-9774




More information about the Squeak-dev mailing list