Add an accessor method to get the slot's index. This will limit the use of AttributeWithIndex.