// the walker is immutable, meaning the only way to
// advance the pointer is to make a new walker object
static persistable class ImmutableListWalker {
L list;
int index;
*(L *list) {}
*(L *list, int *index) {}
bool has() { ret index >= 0 && index < l(list); }
A get() {
ret _get(list, index);
}
ImmutableListWalker next() {
ret new ImmutableListWalker(list, index+1);
}
bool atEnd() {
ret index >= l(list);
}
}