Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!hookup!swrinde!pipex!uunet!wang!news
From: zviki@techunix.technion.ac.il (Cohen Zviki)
Subject: Re: VW2.0 - Using class instance variables (HELP!!!)
Organization: Technion, Israel Institute of Technology
Date: Sat, 4 Feb 1995 13:52:01 GMT
Message-ID: <D3HAIq.2z2@discus.technion.ac.il>
References: <D3F39z.Jsx@discus.technion.ac.il>
Sender: news@wang.com
Lines: 46

	Hello !

Cohen Zviki (zviki@techunix.technion.ac.il) wrote:
: 	Hello !

: 	I'm currently using VW2.0 and I ran into some kind of problems when
: using class instance variables. My goal is to use a variable that will be 
: shared by all the instances of the class (for read only) but it will vary
: among different subclasses of the class. I understand this is the ways to do
: this (e.g., the famous dictionaries example).

: 	I declared the variables by clicking "class" in the browser and 
: entering it there in the class instance definition (or whatever you might call
: that). The problem is, I can use the variable, but I cannot get it to change
: for every subclass I make. The first subclass which is initialized sets the 
: value and the other initializations of the subclasses (and father class) 
: doesn't change the value anymore. 

        I found my problem, I think. What I tried to do is to declare a
class and some subclasses, where all the subs will have a class instance
variable, that will be shared (for reading) among the instances of the
subs and will be different from one sub to another. This is useful since
I can write access methods in the father class only and use it in all the
subs.

        The problem is that class instance variables are not accessible
from instance variables, so we can't use them. We can't use class
variables since those do not change among subclasses of the same father.
It seems we missed something...


                                        Zviki Cohen


------------------------------------------------------------------------------
Zviki Cohen
                                    Computer Science student 
Macintosh Developer                 Technion - Israel Institute of Technology

		E-mail:	zviki@tx.technion.ac.il


  " If I were you I'd really run from me         
    I'd really really wish that I were you "

			Circus Envy - Monster - R.E.M
