summaryrefslogtreecommitdiffstats
path: root/doc/lsort.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-01-20 13:42:17 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-01-20 13:42:17 (GMT)
commit1549d82a2029add6f62dde489d26a70b466f4fd0 (patch)
tree6b453022eb94d1d13ccd73cb7e033e4859af45fd /doc/lsort.n
parentee1c40272a0ee43da070323282205173df4a8816 (diff)
downloadtcl-1549d82a2029add6f62dde489d26a70b466f4fd0.zip
tcl-1549d82a2029add6f62dde489d26a70b466f4fd0.tar.gz
tcl-1549d82a2029add6f62dde489d26a70b466f4fd0.tar.bz2
Use a consistent indentation of 4 for code examples.
Diffstat (limited to 'doc/lsort.n')
-rw-r--r--doc/lsort.n44
1 files changed, 22 insertions, 22 deletions
diff --git a/doc/lsort.n b/doc/lsort.n
index 568f283..7b9d6a6 100644
--- a/doc/lsort.n
+++ b/doc/lsort.n
@@ -7,7 +7,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.33 2009/02/24 21:04:58 dkf Exp $
+'\" RCS: @(#) $Id: lsort.n,v 1.34 2010/01/20 13:42:17 dkf Exp $
'\"
.so man.macros
.TH lsort n 8.5 Tcl "Tcl Built-In Commands"
@@ -101,7 +101,7 @@ returns \fB{Second 18} {First 24} {Third 30}\fR,
'\"
.CS
lsort -index end-1 \e
- {{a 1 e i} {b 2 3 f g} {c 4 5 6 d h}}
+ {{a 1 e i} {b 2 3 f g} {c 4 5 6 d h}}
.CE
.PP
returns \fB{c 4 5 6 d h} {a 1 e i} {b 2 3 f g}\fR,
@@ -109,9 +109,9 @@ and
.PP
.CS
lsort -index {0 1} {
- {{b i g} 12345}
- {{d e m o} 34512}
- {{c o d e} 54321}
+ {{b i g} 12345}
+ {{d e m o} 34512}
+ {{c o d e} 54321}
}
.CE
.PP
@@ -181,44 +181,44 @@ option.
Sorting a list using ASCII sorting:
.PP
.CS
-% \fBlsort\fR {a10 B2 b1 a1 a2}
+\fI%\fR \fBlsort\fR {a10 B2 b1 a1 a2}
B2 a1 a10 a2 b1
.CE
.PP
Sorting a list using Dictionary sorting:
.PP
.CS
-% \fBlsort\fR -dictionary {a10 B2 b1 a1 a2}
+\fI%\fR \fBlsort\fR -dictionary {a10 B2 b1 a1 a2}
a1 a2 a10 b1 B2
.CE
.PP
Sorting lists of integers:
.PP
.CS
-% \fBlsort\fR -integer {5 3 1 2 11 4}
+\fI%\fR \fBlsort\fR -integer {5 3 1 2 11 4}
1 2 3 4 5 11
-% \fBlsort\fR -integer {1 2 0x5 7 0 4 -1}
+\fI%\fR \fBlsort\fR -integer {1 2 0x5 7 0 4 -1}
-1 0 1 2 4 0x5 7
.CE
.PP
Sorting lists of floating-point numbers:
.PP
.CS
-% \fBlsort\fR -real {5 3 1 2 11 4}
+\fI%\fR \fBlsort\fR -real {5 3 1 2 11 4}
1 2 3 4 5 11
-% \fBlsort\fR -real {.5 0.07e1 0.4 6e-1}
+\fI%\fR \fBlsort\fR -real {.5 0.07e1 0.4 6e-1}
0.4 .5 6e-1 0.07e1
.CE
.PP
Sorting using indices:
.PP
.CS
-% # Note the space character before the c
-% \fBlsort\fR {{a 5} { c 3} {b 4} {e 1} {d 2}}
+\fI%\fR # Note the space character before the c
+\fI%\fR \fBlsort\fR {{a 5} { c 3} {b 4} {e 1} {d 2}}
{ c 3} {a 5} {b 4} {d 2} {e 1}
-% \fBlsort\fR -index 0 {{a 5} { c 3} {b 4} {e 1} {d 2}}
+\fI%\fR \fBlsort\fR -index 0 {{a 5} { c 3} {b 4} {e 1} {d 2}}
{a 5} {b 4} { c 3} {d 2} {e 1}
-% \fBlsort\fR -index 1 {{a 5} { c 3} {b 4} {e 1} {d 2}}
+\fI%\fR \fBlsort\fR -index 1 {{a 5} { c 3} {b 4} {e 1} {d 2}}
{e 1} {d 2} { c 3} {b 4} {a 5}
.CE
.PP
@@ -226,17 +226,17 @@ Sorting using indices:
Sorting a dictionary:
.PP
.CS
-% set d [dict create c d a b h i f g c e]
+\fI%\fR set d [dict create c d a b h i f g c e]
c e a b h i f g
-% \fBlsort\fR -stride 2 $d
+\fI%\fR \fBlsort\fR -stride 2 $d
a b c e f g h i
.CE
.PP
Sorting using striding and multiple indices:
.PP
.CS
-% # Note the first index value is relative to the group
-% \fBlsort\fR \-stride 3 \-index {0 1} \e
+\fI%\fR # Note the first index value is relative to the group
+\fI%\fR \fBlsort\fR \-stride 3 \-index {0 1} \e
{{Bob Smith} 25 Audi {Jane Doe} 40 Ford}
{{Jane Doe} 40 Ford {Bob Smith} 25 Audi}
.CE
@@ -245,14 +245,14 @@ Sorting using striding and multiple indices:
Stripping duplicate values using sorting:
.PP
.CS
-% \fBlsort\fR -unique {a b c a b c a b c}
+\fI%\fR \fBlsort\fR -unique {a b c a b c a b c}
a b c
.CE
.PP
More complex sorting using a comparison function:
.PP
.CS
-% proc compare {a b} {
+\fI%\fR proc compare {a b} {
set a0 [lindex $a 0]
set b0 [lindex $b 0]
if {$a0 < $b0} {
@@ -262,7 +262,7 @@ More complex sorting using a comparison function:
}
return [string compare [lindex $a 1] [lindex $b 1]]
}
-% \fBlsort\fR -command compare \e
+\fI%\fR \fBlsort\fR -command compare \e
{{3 apple} {0x2 carrot} {1 dingo} {2 banana}}
{1 dingo} {2 banana} {0x2 carrot} {3 apple}
.CE