this gotta be the most diabolical way to count numbers yet i love this language ...

@kimapr@ublog.kimapr.net

this gotta be the most diabolical way to count numbers yet i love this language

import java.util.Spliterators.AbstractSpliterator
import java.util.stream.StreamSupport
import java.util.function.Consumer

for (i : (Iterable<Integer>) () -> StreamSupport.stream(
	new AbstractSpliterator<Integer>(Long.MAX_VALUE, 0) {
		int val = 0;
		boolean tryAdvance(Consumer action) {
			action.accept(val++); return true;
		}
	}, false
).iterator()) {
	println i
}