Sort stability: Difference between revisions
Content added Content deleted
(Added Elixir) |
|||
Line 130: | Line 130: | ||
=={{header|Common Lisp}}== |
=={{header|Common Lisp}}== |
||
Common Lisp provides the two functions [http://www.lispworks.com/documentation/HyperSpec/Body/f_sort_.htm <code>sort</code> and <code>stable-sort</code>]. |
Common Lisp provides the two functions [http://www.lispworks.com/documentation/HyperSpec/Body/f_sort_.htm <code>sort</code> and <code>stable-sort</code>]. |
||
Each of these functions can sort arbitrary objects using a given predicate function, the input to which can be altered by the optional <code>key</code> parameter. |
|||
(eg; sorting file names based upon file sizes, the predicate might be <code><</code> and the <code>key</code> could be a function that transforms the file's name into its size) |
|||
=={{header|D}}== |
=={{header|D}}== |