Algorithm.sort

Sorts an enumerable in place and returns a range.

Arguments

The

enumerable
to sort. Can be a builtin-list or an Array or an Array Range (then the result will be an Array Range), or a LinkedList or a LinkedList Range (then the result will be a LinkedList Range).

Return values

The

range
of all elements of the sorted enumerable (see Range).

Complexity

Depends on the enumerable.

Example

"sl/algorithm" useFile "sl/linkedList" useFile a: (1 2 3 -1 -2 -3) makeList; r: a sort; r [print "," print] each
Output:
-3,-2,-1,1,2,3,