persistable sclass AutoGrowingList extends RandomAccessAbstractList {
new L list;
IF1 createEmptyElement; // optional, takes index and produces element
*(IF1 *createEmptyElement) {}
*(IF0 createEmptyElement) { this(if0ToIF1(createEmptyElement)); }
public int size() { ret list.size(); }
public A get(int i) { ret list.get(i); }
public A set(int i, A a) {
while (i > size())
list.add(createEmptyElement?.get(i));
if (i == size()) {
add(a);
null;
} else
ret list.set(i, a);
};
public bool add(A a) { ret list.add(a); }
}