Path: utzoo!attcan!uunet!samsung!caesar.cs.montana.edu!blake!ogccse!orstcs!mist!chouc From: chouc@mist.cs.orst.edu (Chou Chung-Di) Newsgroups: comp.lang.smalltalk Subject: Re: ST V/286 a few questions... Message-ID: <13964@orstcs.CS.ORST.EDU> Date: 25 Nov 89 07:10:51 GMT References: <441@DB0TUI11.BITNET> Sender: usenet@orstcs.CS.ORST.EDU Reply-To: chouc@mist.CS.ORST.EDU (Chou Chung-Di) Organization: Oregon State Univ. -- Computer Science Lines: 73 I think I could provide some help on the third item in the third question: "How do you introduce new instance variables to the existing class?". I have applied this method in many situations, and it appeared to work well for my programs. To incrementally add new instance variables to a class with existing instance variables, you should go to the class definition area (the bottom text pane of the ClassHierarchyBrowser, but actually you could do this in any textpane, this is just for the convenience of changing things faster). For example, it may look like: Object subclass: #MyObjectClass instanceVariableNames: 'variable1 variable2' classVariableNames: '' poolDictionaries: '' Suppose you want to add a new instance variable called 'variable3' to MyObjectClass (or a bunch of them, maybe). You should try to edit the text so it looks like the following (it is simply a Smalltalk expression): MyObjectClass instVarNames: 'variable1 variable2 variable3'. and evaluate the expression with "do it". After that, you have already changed the data structure of the class MyObjectClass, what you need to do then is to recompile all the methods that are already installed in your class. To do this, evaluate the following expression with do it: MyObjectClass compileAll. Then you should be able to initialze the new instance variable variable3 and use it accordingly. All of these methods reside in the class Behavior in Smalltalk/V 286. MetaClass might also have some interesting methods which you might want to take a look at. Remember, the new instance variable no longer applies to the previous (possibly) opened window applications. So as one possible reason to your first question (panes do not get updated), I like to ask you to check the possibility that you reuse the original applications (windows) after you made the changes. I had similar symptoms when I was developing some of my programs before, and it was worse because even I only specified ONE "changed" method in the invoking method, the dependent panes updated twice! So far I did not have time to look at the problem. As one other diagnosis to your first question, it might be the effect of global variables floating around in your image, sometimes you need to re-initialize them. This is just my guess because I cna't infer much information from your description. One last comment to the adding new instance variable - I think it would be a good practice to do this using inheritance - i.e., to create your own class and do these management. This is to save yourself from getting confused about what methods are really written by you - as you will be filing out the classes to disk in the future. Regarding the Exception error code on question two, I notice that Digitalk had many versions (to my knowledge, at least two) of the v.exe file. As I can recall, some of them have serious bugs. As you could imagine, they generate fatal errors (and if you did not save your work frequent enough, you would be in BIG BIG trouble). So check your date on the file v.exe. It should be dated like september 88 (Sorry, I don't have the disk with me, so I can only guess). As far as I know, this error is generated by the 386 protected mode exceptions, but how it got there is unknown to me! ----------------------------------------------------------------------------- Disclaimer: Make backup before you try my ideas. Chung-Di (Tony) Chou Department of Industrial and Manufacturing Engineering Oregon State University Corvallis, OR 97331 USA