clipperhouse/gen

Stable sort

aseemk opened this issue · 0 comments

Hi folks,

Great work on gen — it's very useful.

I'm unclear on whether Sort(By) is a stable sort or not. The code docs say the code is a modified version of https://golang.org/pkg/sort/#Sort — which is not stable. Is that still the case in this modified version? (Would be great to document this either way.)

If so, would it be possible to add stable versions of Sort and SortBy. The latter would be particularly helpful since the sort.Interface can't be code-gen'ed automatically for types that aren't naturally comparable.

Thanks!