Example 1:
_array sortBy [{ _this }, true];
...is equivalent to:
_array sort true;
Example 2:
_array = [
["a1", [1.5, 4.0]],
["a2", [0.1, 7.7]],
["a3", [1.0, 1.0]]
];
_array sortBy [{ ((_this select 1) select 1) }, false];
// -> [a2, a1, a3]
Example 3 (with same array from Example 2):
_array sortBy [{(
((_this select 1) select 0) *
((_this select 1) select 1)
)}, false];
// -> [a1, a3, a2]
...which demonstrates not only "selection", but actually "evaluates" some new value based on <code>. Thus, with respect to a possible implementation, indirect sorting might be required anyways (unless "evaluation" is not allowed, and <code> can only express "selection").
Example 4:
_array = [<list of objects, such as units, buildings, locations, ...>]
_array sortBy [{ (player distance _this) }, true];
...which is also a neat use-case: sorting by things that are dynamic in nature, or things that you do not wanna keep in your (more) persistent data-structures/lists of things.
Alternative command name: indirectSort, or just overload the "sort" command. :)