sortOn: sorts range of aggregates by member name(s)

"Nordlöw" via Digitalmars-d digitalmars-d at puremagic.com
Sun Nov 9 04:49:01 PST 2014


On Sunday, 9 November 2014 at 08:12:37 UTC, Andrei Alexandrescu 
wrote:
> sortBy!(expr) is equivalent with sort!(expr_a < expr_b) so 
> there's no additional power to it. However, it does make some 
> sorting criteria easier to write. A while ago I took a related 
> diff pretty far but in the end decided to discard it because it 
> didn't add sufficient value.

What do you mean by sufficient value?

Ruby has sort_by. I believe D would when possible should be a 
superset of the union of powers available in other languages to 
maximize the ease of porting code *to* D and the pleasure for 
programmers to switch to D. I'll try to make this elegant and 
useful and use it myself for a while. If it works for me I'll do 
a PR still. Ok?


More information about the Digitalmars-d mailing list