Open
Description
The instVarAt:
and instVarAt:put:
methods take an index to access fields.
This index is based on the lexical definition of fields in the class hierarchy.
The first field of the first class with a field is specified to have index 1.
The second field has index 2.
First and second, i.e., ordering are determine by the lexical location in the field definition clause.
Thus, in | a b |
the field a
is the first, and b
is the second field.
The field of a super class directly precedes the field of the class, and that of the super super class precedes the fields of the super class, and so on.
Thus, in the following examples the fields have the following indexes:
A = (
| a b |
)
B = A (
| c d |
)
- a
- b
- c
- d