If you are coming from a Pascal background, instance variables of an object correspond to fields of a record.
They are called instance variables - because they are variables - that belong to INSTANCES of a class (object) as opposed to class variables - which are variables - that belong to the CLASS itself and are thus shared by all instances. Other programming languages use terminology like slots, fields, data members, ... The keyword 'instanceVariableNames:' is used because the string that follows contains the names of the variables, not the variables themselves. One thing to note is that in Smalltalk all instance variables (fields, slots, whatever) are PRIVATE. These are not the names of accessor methods, although there may be accessor methods with the same spelling. On Tue, 7 Dec 2021 at 05:32, <danhunfe...@mail.com> wrote: > Object subclass: #Test > instanceVariableNames: 'var1 var2' > classVariableNames: '' > package: 'MyTest' > > I was struggling with instanceVariableNames even though they show up under > methods. Perhaps I'm just slow, but it wasn't until last night when I was > reading on Object Pascal and there was an example: > > type > TProjector = class(TTelevision) > Brightness, Temperature: Integer; > procedure Focus(Length: Single); > end; > > Then it finally clicked with me that "var1" and "var2" under instance > variables in Smalltalk would be like the method "Focus" in Object Pascal. Is > that correct, or am I still not getting it? > >