Is there anything in the standard library for buil...
# getting-started
m
Is there anything in the standard library for building an iterator from a list of iterables?
It seems it’s:
flatten().iterator()
And how about for building an iterator for a single item? Something better than
listOf(item).iterator()
i
Better to convert a list of iterables to a sequence of iterables, then call
flatten().iterator()
. Otherwise
flatten
invoked on a list will materialize list with all flattened elements — perhaps not what you wanted.
👍 1
m
That’s much better, thanks!