# Stdlib feedback

**URL:** <https://discuss.kotlinlang.org/t/stdlib-feedback/938>\
**Category:** Uncategorized\
**Created:** [January 24, 2013, 9:16am UTC](https://discuss.kotlinlang.org/t/stdlib-feedback/938 "2013-01-24T09:16:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamiemccrindle](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/jamiemccrindle/32/1600_2.png) [@jamiemccrindle](https://discuss.kotlinlang.org/u/jamiemccrindle)\
**Post date:** [January 24, 2013, 9:16am UTC](https://discuss.kotlinlang.org/t/stdlib-feedback/938/1 "2013-01-24T09:16:24Z")

</div>

I've been going through the standard library and have some feedback.

There are a number of methods that are common across List\<T\>, Collection\<T\>, Iterable\<T\>, Array\<T\>, \*Array, Iterator\<T\> etc.

I noticed some differences, so I made a spreadsheet: [https://docs.google.com/spreadsheet/ccc?key=0Aq-5U2bpBIskdDdWdkNjaE55dDFtU3h5NXI1VF9Mc0E](https://docs.google.com/spreadsheet/ccc?key=0Aq-5U2bpBIskdDdWdkNjaE55dDFtU3h5NXI1VF9Mc0E)

Most of the gaps are expected (e.g. not having toArray on Array classes). There were some interesting differences, mostly on Iterator\<T\>:

- Iterator\<T\> could have the following methods: contains, notEmpty, dropWhile, last, mapTo, sort, sortBy, toSortedList, withIndices
- Iterator\<T\> has these additional methods, which the others could have: toLinkedSet, toHashSet, toArrayList

Separately, I think it would be useful for ImmutableArrayListBuilder’s add method to be fluent i.e. public fun add(item: T): ImmutableArrayListBuilder\<T\>. It would also be handy to have an addAll(Iterable\<T\> iterable): ImmutableArrayListBuilder\<T\> on ImmutableArrayListBuilder. I’d be happy to contribute this.

---

<div class="post-metadata">

**Author:** ![abreslav](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/abreslav/32/8279_2.png) [@abreslav](https://discuss.kotlinlang.org/u/abreslav)\
**Post date:** [January 24, 2013, 5:15pm UTC](https://discuss.kotlinlang.org/t/stdlib-feedback/938/2 "2013-01-24T17:15:09Z")

</div>

Thanks for your feedback. It's very useful!
