hho
09/26/2017, 2:53 PMlistOf(1, 2, 3, 4, 5, 6).chunked(2, { it[0] to it[1] }).toMap()
seems to work, but you're creating a List
for every map entry...
(EDIT: Cleaned up thanks to karelpeeters)ilya.gorbunov
09/26/2017, 4:08 PMchunked
it is applied immediately to each chunk list and then the list is reused for the next chunk