Sorting and comparator

Greg Dennis gdennis at alum.mit.edu
Thu Nov 22 06:46:29 PST 2012


> Currently the idiom to sort a stream of Person by name is to call:
>    people.sorted(Comparators.comparing(Person::getName))


 If this idiom is stuck with, maybe "comparing" could be renamed to "by".
With a static import, this could read nicely:
  people.sorted(by(Person::getName))

Greg


More information about the lambda-libs-spec-observers mailing list