static Iterator iterator_gen(O o) { if (o == null) ret emptyItIt(); if (o cast Iterator) ret o; if (o cast Iterable) ret o.iterator(); if (o cast O[]) ret arrayIterator(o); fail("Not iterable: " + className(o)); }