Comment #7 on issue 8762 by
l...@google.com: Move sort to Iterable, return
It seems the request is really for something like (on Iterable<E>):
List<E> toSortedList([int compare(E e1, E e2)]) =>
this.toList()..sort(compare);
While it sure is doable (it's a one-liner), it's also just a shorthand for
two existing basic operations. There is no end to the number of such
combinations we can add, but I'm not sure its really worth it. Adding more
methods on Iterable will likely make it harder to figure out which one to
use, especially when some of them are redundant.
But I also don't really feel the hurt of .toList()..sort(). It's clear what
it is doing, and it doesn't hide that it has to allocate a list.