aboutsummaryrefslogtreecommitdiff
path: root/jim_tcl.txt
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2013-11-10 12:57:59 +1000
committerSteve Bennett <steveb@workware.net.au>2013-12-11 06:07:00 +1000
commitee08ea6a4454de6b8dca0f14446a6b8b29cc1458 (patch)
tree9c7275210b4072ed93f94f418233d247e6b67280 /jim_tcl.txt
parente18a8843ab70d6b3d20c7b384e7aef762474d7be (diff)
downloadjimtcl-ee08ea6a4454de6b8dca0f14446a6b8b29cc1458.zip
jimtcl-ee08ea6a4454de6b8dca0f14446a6b8b29cc1458.tar.gz
jimtcl-ee08ea6a4454de6b8dca0f14446a6b8b29cc1458.tar.bz2
Add support for lsort -unique
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim_tcl.txt')
-rw-r--r--jim_tcl.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/jim_tcl.txt b/jim_tcl.txt
index d2e9636..85d5046 100644
--- a/jim_tcl.txt
+++ b/jim_tcl.txt
@@ -56,6 +56,7 @@ Changes between 0.74 and 0.75
1. `binary`, `pack` and `unpack` now support floating point
2. `file copy` '-force' handles source and target as the same file
3. `format` now supports +%b+ for binary conversion
+3. `lsort` now supports '-unique' and '-real'
Changes between 0.73 and 0.74
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -3136,7 +3137,7 @@ the list are to be matched against pattern and must have one of the values below
lsort
~~~~~
-+*lsort* ?*-index* 'listindex'? ?*-nocase!-integer|-real|-command* 'cmdname'? ?*-decreasing*|*-increasing*? 'list'+
++*lsort* ?*-index* 'listindex'? ?*-nocase!-integer|-real|-command* 'cmdname'? ?*-unique*? ?*-decreasing*|*-increasing*? 'list'+
Sort the elements of +'list'+, returning a new list in sorted order.
By default, ASCII (or UTF-8) sorting is used, with the result in increasing order.
@@ -3156,6 +3157,10 @@ than, equal to, or greater than +'$value2'+, respectively.
If +-decreasing+ is specified, the resulting list is in the opposite
order to what it would be otherwise. +-increasing+ is the default.
+If +-unique+ is specified, then only the last set of duplicate elements found in the list will be retained.
+Note that duplicates are determined relative to the comparison used in the sort. Thus if +-index 0+ is used,
++{1 a}+ and +{1 b}+ would be considered duplicates and only the second element, +{1 b}+, would be retained.
+
If +-index 'listindex'+ is specified, each element of the list is treated as a list and
the given index is extracted from the list for comparison. The list index may
be any valid list index, such as +1+, +end+ or +end-2+.