One thing that’s curious to me - it seems implicit that ALL classes are [slot] unless otherwise specified.
It’s possible Sc does this differently, but in Smalltalk only some classes have indexed instance variables:
Indexed Instance Variables: Instances of some classes can have instance variables that are not accessed by names. These are called indexed instance variables. Instead of being referred to by name, indexed instance variables are referred to by messages that include integers, called indices, as arguments. Since indexing is a form of association, the two fundamental indexing messages have the same selectors as the association messages to dictionaries–at: and at:put:. […] A class whose instances have indexed instance variables can also have named instance variables. All instances of such a class will have the same number of named instance variables, but may have different numbers of indexed variables. (Blue Book, p. 46)
Classes with indexed variables have a “new:” constructor instead of “new”, the argument sets the number of indexable variables, and also a “size” message that gives the number of indexed variables, c.f.
A similar pair for creating variable length objects, new: and basicNew:, are also provided in the protocol of class Behavior. (Note, this technique of dual messages is also used in class Object for accessing messages such as at: and at:put:.) (p. 274)
The Squeak comments for these are quite nice, copied below.
“Primitive. Answer an instance of this class with the number of indexable
variables specified by the argument, sizeRequested. Fail if this class is not
indexable or if the argument is not a positive Integer, or if there is not
enough memory available. Essential.”
“Primitive. Assumes receiver is indexable. Answer the value of an
indexable element in the receiver. Fail if the argument index is not an
Integer or is out of bounds. Essential.”
basicAt: index put: value
“Primitive. Assumes receiver is indexable. Store the second argument
value in the indexable element of the receiver indicated by index. Fail
if the index is not an Integer or is out of bounds. Or fail if the value is
not of the right type for this kind of collection. Answer the value that
was stored. Essential.”