Guest User

Untitled

a guest
Apr 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. tailrec fun <T, R> Iterable<T>.mapWithConsIter(result: Cons<R>, src: Iterator<T>, cb: (T) -> R): List<R> {
  2. if (!src.hasNext()) {
  3. return result
  4. }
  5. val e = src.next()
  6. return mapWithConsIter(Cons<R>(cb(e), result), src, cb)
  7. }
Add Comment
Please, Sign In to add comment