diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2001-09-28 15:32:17 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2001-09-28 15:32:17 (GMT) |
commit | 98bc47debac65f50b1b14eb7c32f6afe37bdf51a (patch) | |
tree | 24d4af32d308623f80fbcb56ee84f241ea3d63fa /doc | |
parent | cae247df825bf42c0dd22f43f2047a307d54eb65 (diff) | |
download | tcl-98bc47debac65f50b1b14eb7c32f6afe37bdf51a.zip tcl-98bc47debac65f50b1b14eb7c32f6afe37bdf51a.tar.gz tcl-98bc47debac65f50b1b14eb7c32f6afe37bdf51a.tar.bz2 |
Fixed Bug #465674 reported by me. [lsort -index end-1] now behaves sensibly...
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lsort.n | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/doc/lsort.n b/doc/lsort.n index 2a21aa2..67f7f09 100644 --- a/doc/lsort.n +++ b/doc/lsort.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lsort.n,v 1.9 2001/03/30 00:56:02 hobbs Exp $ +'\" RCS: @(#) $Id: lsort.n,v 1.10 2001/09/28 15:32:17 dkf Exp $ '\" .so man.macros .TH lsort n 8.3 Tcl "Tcl Built-In Commands" @@ -65,15 +65,30 @@ Sort the list in decreasing order (``largest'' items first). .TP 20 \fB\-index\0\fIindex\fR If this option is specified, each of the elements of \fIlist\fR must -itself be a proper Tcl sublist. Instead of sorting based on whole sublists, -\fBlsort\fR will extract the \fIindex\fR'th element from each sublist -and sort based on the given element. The keyword \fBend\fP is allowed -for the \fIindex\fP to sort on the last sublist element. For example, +itself be a proper Tcl sublist. Instead of sorting based on whole +sublists, \fBlsort\fR will extract the \fIindex\fR'th element from +each sublist and sort based on the given element. The keyword +\fBend\fP is allowed for the \fIindex\fP to sort on the last sublist +element, +.VS 8.4 +and \fBend-\fIindex\fR sorts on a sublist element offset from +the end. +.VE +For example, .RS .CS lsort -integer -index 1 {{First 24} {Second 18} {Third 30}} .CE -returns \fB{Second 18} {First 24} {Third 30}\fR. +returns \fB{Second 18} {First 24} {Third 30}\fR, and +.VS 8.4 +'\" +'\" This example is from the test suite! +'\" +.CS +lsort -index end-1 {{a 1 e i} {b 2 3 f g} {c 4 5 6 d h}} +.CE +returns \fB{c 4 5 6 d h} {a 1 e i} {b 2 3 f g}\fR. +.VE This option is much more efficient than using \fB\-command\fR to achieve the same effect. .RE |