static L> indexAsSideValue(L l) { L> out = emptyList(l); int n = l(l); for i to n: out.add(withSideValue(i, l.get(i))); ret out; }