class instance variables

Yanni Jew yanni at home.com
Fri May 11 18:14:51 UTC 2001


Tim Rowledge wrote:
> 
> Yanni Jew <yanni at home.com> is widely believed to have written:
> 
> > Is there ready to use support for class instance variables in Squeak?
> Yup. It's been there for, ohh, twenty years maybe?

Maybe it's my imagination, but I could have sworn that the syntax
was on the instance side. Something like:
    ...
    instanceVariableNames: ''
    classInstanceVariableNames: ''  <--
    classVariableNames: ''
    poolDictionaries: ''
    category: ''

But I've checked STExpress and VWNC30, and they're like Squeak.
So, maybe it's IBM Smalltalk, which I don't have.

> [snip]
> In a borwser you can add class instance variables simply by picking your
> class, goingto the classside messages, adding the variable to the
>         Blah class instanceVariableNames: ''
> line and accepting. No problem.

Doh, I thought the answer was staring me in the face. For years now,
I've been ignoring that text, and immediately selecting a class method.

> > Then added an instance method:
> >     SAActiveObject>>stateModel
> >         ^self class instVarAt: 12
> >
> > which is needed because the compiler doesn't know about the new
> > variable.
> could be because you used a capitalised name in one part of your example
> and non-capitalised in the other? I had no problem adding a var and then
> a method to use it.

Doh, again. Another post had the answer -- class methods know about it,
not instance methods. I think JAVA and C++ have messed with my head. :-)

Thanks everyone for the replies.
--yanni





More information about the Squeak-dev mailing list