Programming Question

kpgrant at mindspring.com kpgrant at mindspring.com
Fri Apr 9 08:10:32 UTC 1999


Here's one I'm having trouble figuring out...

I have an object of class String something like the following:

  className := 'OrderedCollection'

What I want to do is something like:

  newObject := (className asClass) new

Of course there is no such message as "asClass".  The problem
is that I can find no way to cause newObject to become a new
object of class OrderedCollection.  Basically, I've got a string
object whose contents are the name of some class, and I need to be
able to send class-side messages like "new" to whichever class
is named in the string, but I can't seem to find a mechanism for
doing this.

Thanks,
-Kevin





More information about the Squeak-dev mailing list