Search the web
Sign In
New User? Sign Up
squeak
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Class Name   Message List  
Reply | Forward Message #94869 of 143988 |
Re: Class Name


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





Tue May 24, 2005 1:21 pm

hboon@...
Send Email Send Email

Forward
Message #94869 of 143988 |
Expand Messages Author Sort by Date

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,...
BELEM Mahamadou
mabelem2003@...
Send Email
May 24, 2005
11:51 am

... myCar := Car new. myCar perform: #run ... This looks right actually. For eg. 1 className "answers 'SmallInteger'" You can try reading the books found at...
Yar Hwee Boon
hboon@...
Send Email
May 24, 2005
1:21 pm

... What Mahamadou tried to achieve is more like this: myClassName := 'Car'. myObject := (Smalltalk at: myClassName asSymbol) new. myObject run However, this...
Hans-Martin Mosner
hmm@...
Send Email
May 24, 2005
5:00 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help