On Monday, 30 May 2016 at 17:14:47 UTC, Andrew Godfrey wrote:
I like "make string iteration explicit" but I wonder about other constructs. E.g. What about "sort an array of strings"? How would you tell a generic sort function whether you want it to interpret strings by code unit vs code point vs grapheme?
The comparison predicate does that... sort!( (string a, string b) { /* you interpret a and b here and return the comparison */ })(["hi", "there"]);