// pred: func(int) -> bool static L mapLike filterListByPredicateOnIndex(O pred, L l) { new L out; int n = l(l); for i to n: if (isTrue_callF(pred, i)) out.add(l.get(i)); ret out; }