sclass mapI_It extends IterableIterator { O f; Iterator i; *() {} *(O *f, Iterator *i) {} public bool hasNext() { ret i.hasNext(); } public O next() { ret callF(f, i.next()); } toString { ret formatFunctionCall('mapI, f, i); } } // apply a function to an iterator static IterableIterator lambdaMapLike mapI(final O f, final Iterator i) { ret mapI_It(f, i); } ifclass IterableIterator static IterableIterator mapI(IterableIterator i, O f) { ret mapI((Iterator) i, f); } static IterableIterator mapI(O f, IterableIterator i) { ret mapI((Iterator) i, f); } endif static IterableIterator mapI(Iterator i, O f) { ret mapI(f, i); } static ItIt mapI(Iterable i, IF1 f) { ret new MapI(f, iterator(i)); } static ItIt mapI(Iterator i, IF1 f) { ret new MapI(f, i); } static ItIt mapI(ItIt i, IF1 f) { ret new MapI(f, i); } static ItIt mapI(IF1 f, Iterable i) { ret new MapI(f, iterator(i)); } static IterableIterator mapI(Iterable i, O f) { ret mapI(f, i.iterator()); } static IterableIterator mapI(O f, Iterable i) { ret mapI(i, f); }