Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!newstand.syr.edu!news.maxwell.syr.edu!www.nntp.primenet.com!nntp.primenet.com!news.bbnplanet.com!su-news-hub1.bbnplanet.com!newsfeed.internetmci.com!dciteleport.com!worldnet.att.net!uunet!in3.uu.net!uucp3.uu.net!world!carlg
From: carlg@world.std.com (Carl E Gundel)
Subject: Re: Smalltalk Express Questions
Message-ID: <E29JI1.AI9@world.std.com>
Organization: The World, Public Access Internet, Brookline, MA
X-Newsreader: TIN [version 1.2 PL2]
References: <01bbe712$06de9a60$2c71facd@PhilAmyotte>
Date: Wed, 11 Dec 1996 19:01:12 GMT
Lines: 35

Phil Amyotte (phila@magmacom.com) wrote:
: I have just begun coding using the STEX freeware, and I have a couple of
: (hopefully easy) questions:

: (a)  I have run into a problem where I cannot add an instance variable to
:      a class if there are existing instances of this class (I get the
:      'HasInstances' error).  How can I get rid of all these existing
:      instances?  I thought the 'initializeClass' method would do the
:      trick, but it doesn't seem sufficient.  Funny, I never
:      encountered this problem using Smalltalk/V.

The common fix is to evaluate the following before recompiling your class:

  YourClassName allInstances do: [ :each | each become: String new ]

BTW, Smalltalk Express _is_ Smalltalk/V (new name, same old Smalltalk).

: (b)  Is there any way to translate specific classes from the STEX image
:      to C++ classes?  This is probably a recurring question, but I
:      consulted the FAQ to no avail.

Not really.  You can rewrite them in C++ yourself, or hire someone else to 
do it for you.  Are you interested in the Collection classes or some 
other base class or classes?  There must be commercial (or free) 
libraries for C++ that model some Smalltalk base classes.

Regards,

Carl

-- 
------------------------------------------------------------------
 Carl Gundel  carlg@world.std.com  Shoptalk Systems  508-872-5315
 author of Liberty BASIC, a 1996 PC Magazine Awards Finalist!
 http://world.std.com/~carlg/basic.html
