Sorting a list
In order to sort a list Tcl has provided the lsort
command. As with other commands this one accepts numerous options that we will cover prior to discussing the syntax. The options are as follows:
Options |
Interpretations |
---|---|
|
Sorts using string comparison with Unicode code-point collation order. |
|
Sorts using dictionary style comparison. |
|
Converts the list elements to integers and use integer comparison. |
|
Converts the list elements to floating-point values and use floating-point comparison. |
|
Uses the command provided as a comparison command. |
|
Sorts in increasing order. |
|
Sorts in decreasing order. |
|
Returns a list of indices in sorted order as opposed to the values. |
|
For this option to be specified each element of the list must be a proper Tcl sublist. |
|
Sorts using a case-insensitive comparison. |
|
Returns only the last set... |