static L map_printProgress(Collection l, O f) { ret map_printProgress(f, l); } static L map_printProgress(O f, Collection l) { L x = emptyList(l); if (nempty(l)) { int i = 0, n = l(l); S desc = null; NotTooOften nto = onlyEverySecond(); nto.yo(); // wait 1 second before printing bool printed = false; for (O o : l) { x.add(callF(f, o)); ++i; if (nto.yo()) { printed = true; if (desc == null) desc = shorten(str(f), 20); print(desc + ": " + i + "/" + n); } } if (printed) print(desc + ": " + n + " done"); } ret x; }