// iterate safely (& quickly) in the face of concurrent modifications
static IterableIterator concurrentlyIterateList(final L l) {
ret iteratorFromFunction_withEndMarker_f0(new F0() {
int i;
A get() {
int _i = i++;
synchronized(l) {
if (_i < l(l)) {
A a = l.get(_i);
if (a == iteratorFromFunction_endMarker) fail("no"); // ugly comparison fail-fast redemption
ret a;
}
ret (A) iteratorFromFunction_endMarker; // ugly cast
}
}
});
}