summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/apply.n10
-rw-r--r--doc/array.n10
-rw-r--r--doc/expr.n12
-rw-r--r--doc/join.n11
-rw-r--r--doc/lassign.n32
-rw-r--r--doc/lindex.n26
-rw-r--r--doc/lrepeat.n27
-rw-r--r--doc/lreverse.n24
-rw-r--r--doc/lsearch.n62
-rwxr-xr-xdoc/lset.n32
-rw-r--r--doc/regexp.n13
-rw-r--r--doc/split.n17
12 files changed, 157 insertions, 119 deletions
diff --git a/doc/apply.n b/doc/apply.n
index 1e69e69..22b068d 100644
--- a/doc/apply.n
+++ b/doc/apply.n
@@ -65,6 +65,7 @@ proc apply {fun args} {
This shows how to make a simple general command that applies a transformation
to each element of a list.
.CS
+.ta 2i
proc map {lambda list} {
set result {}
foreach $item $list {
@@ -73,21 +74,24 @@ proc map {lambda list} {
return $result
}
map {x {return [string length $x]:$x}} {a bb ccc dddd}
- \fI=> 1:a 2:bb 3:ccc 4:dddd\fR
+ \fB\(->\fI 1:a 2:bb 3:ccc 4:dddd\fR
map {x {expr {$x**2 + 3*$x - 2}}} {-4 -3 -2 -1 0 1 2 3 4}
- \fI=> 2 -2 -4 -4 -2 2 8 16 26\fR
+ \fB\(->\fI 2 -2 -4 -4 -2 2 8 16 26\fR
.CE
.PP
The \fBapply\fR command is also useful for defining callbacks for use in the
\fBtrace\fR command:
.CS
+.ta 2i
set vbl "123abc"
trace add variable vbl write {\fBapply\fR {v1 v2 op} {
upvar 1 $v1 v
- puts "updated variable to \\"$v\\""
+ puts "updated variable to \e"$v\e""
}}
set vbl 123
+ \fB\(->\fI updated variable to "123"\fR
set vbl abc
+ \fB\(->\fI updated variable to "abc"\fR
.CE
.SH "SEE ALSO"
proc(n), uplevel(n)
diff --git a/doc/array.n b/doc/array.n
index 7857615..8c930ba 100644
--- a/doc/array.n
+++ b/doc/array.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: array.n,v 1.16 2007/10/24 14:29:38 dkf Exp $
+'\" RCS: @(#) $Id: array.n,v 1.17 2007/10/25 09:25:27 dkf Exp $
'\"
.so man.macros
.TH array n 8.3 Tcl "Tcl Built-In Commands"
@@ -148,7 +148,7 @@ The command always returns an empty string.
foreach {color count} [\fBarray get\fR colorcount] {
puts "Color: $color Count: $count"
}
- => Color: blue Count: 4
+ \(-> Color: blue Count: 4
Color: white Count: 9
Color: green Count: 5
Color: red Count: 1
@@ -156,7 +156,7 @@ foreach {color count} [\fBarray get\fR colorcount] {
foreach color [\fBarray names\fR colorcount] {
puts "Color: $color Count: $colorcount($color)"
}
- => Color: blue Count: 4
+ \(-> Color: blue Count: 4
Color: white Count: 9
Color: green Count: 5
Color: red Count: 1
@@ -164,13 +164,13 @@ foreach color [\fBarray names\fR colorcount] {
foreach color [lsort [\fBarray names\fR colorcount]] {
puts "Color: $color Count: $colorcount($color)"
}
- => Color: blue Count: 4
+ \(-> Color: blue Count: 4
Color: green Count: 5
Color: red Count: 1
Color: white Count: 9
\fBarray statistics\fR colorcount
- => 4 entries in table, 4 buckets
+ \(-> 4 entries in table, 4 buckets
number of buckets with 0 entries: 1
number of buckets with 1 entries: 2
number of buckets with 2 entries: 1
diff --git a/doc/expr.n b/doc/expr.n
index bf7118a..2a1b18c 100644
--- a/doc/expr.n
+++ b/doc/expr.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: expr.n,v 1.25 2007/10/24 14:29:38 dkf Exp $
+'\" RCS: @(#) $Id: expr.n,v 1.26 2007/10/25 09:35:14 dkf Exp $
'\"
.so man.macros
.TH expr n 8.5 Tcl "Tcl Built-In Commands"
@@ -107,11 +107,11 @@ the variable \fBb\fR has the value 6.
Then the command on the left side of each of the lines below
will produce the value on the right side of the line:
.CS
-.ta 6c
-\fBexpr\fR 3.1 + $a \fI6.1\fR
-\fBexpr\fR 2 + "$a.$b" \fI5.6\fR
-\fBexpr\fR 4*[llength "6 2"] \fI8\fR
-\fBexpr\fR {{word one} < "word $a"} \fI0\fR
+.ta 3.5i
+\fBexpr\fR 3.1 + $a \fB\(-> \fI6.1\fR
+\fBexpr\fR 2 + "$a.$b" \fB\(-> \fI5.6\fR
+\fBexpr\fR 4*[llength "6 2"] \fB\(-> \fI8\fR
+\fBexpr\fR {{word one} < "word $a"} \fB\(-> \fI0\fR
.CE
.SS OPERATORS
.PP
diff --git a/doc/join.n b/doc/join.n
index bf26c44..2696295 100644
--- a/doc/join.n
+++ b/doc/join.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: join.n,v 1.5 2004/10/27 12:53:22 dkf Exp $
+'\" RCS: @(#) $Id: join.n,v 1.6 2007/10/25 09:25:27 dkf Exp $
'\"
.so man.macros
.TH join n "" Tcl "Tcl Built-In Commands"
@@ -16,7 +16,6 @@ join \- Create a string by joining together list elements
.SH SYNOPSIS
\fBjoin \fIlist \fR?\fIjoinString\fR?
.BE
-
.SH DESCRIPTION
.PP
The \fIlist\fR argument must be a valid Tcl list.
@@ -27,20 +26,20 @@ The \fIjoinString\fR argument defaults to a space character.
.SH EXAMPLES
Making a comma-separated list:
.CS
+.ta 2i
set data {1 2 3 4 5}
\fBjoin\fR $data ", "
- \fB=> 1, 2, 3, 4, 5\fR
+ \fB\(->\fI 1, 2, 3, 4, 5\fR
.CE
.PP
Using \fBjoin\fR to flatten a list by a single level:
.CS
+.ta 2i
set data {1 {2 3} 4 {5 {6 7} 8}}
\fBjoin\fR $data
- \fB=> 1 2 3 4 5 {6 7} 8\fR
+ \fB\(->\fI 1 2 3 4 5 {6 7} 8\fR
.CE
-
.SH "SEE ALSO"
list(n), lappend(n), split(n)
-
.SH KEYWORDS
element, join, list, separator
diff --git a/doc/lassign.n b/doc/lassign.n
index f27422d..4d1c3c8 100644
--- a/doc/lassign.n
+++ b/doc/lassign.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: lassign.n,v 1.1 2004/01/17 00:28:08 dkf Exp $
+'\" RCS: @(#) $Id: lassign.n,v 1.2 2007/10/25 09:31:52 dkf Exp $
'\"
.so man.macros
.TH lassign n 8.5 Tcl "Tcl Built-In Commands"
@@ -16,7 +16,6 @@ lassign \- Assign list elements to variables
.SH SYNOPSIS
\fBlassign \fIlist varName \fR?\fIvarName ...\fR?
.BE
-
.SH DESCRIPTION
.PP
This command treats the value \fIlist\fR as a list and assigns
@@ -29,27 +28,30 @@ unassigned elements is returned.
An illustration of how multiple assignment works, and what happens
when there are either too few or too many elements.
.CS
-lassign {a b c} x y z ;# Empty return
-puts $x ;# Prints "a"
-puts $y ;# Prints "b"
-puts $z ;# Prints "c"
+.ta 2.5i
+lassign {a b c} x y z \fB\(->\fI Empty return\fR
+puts $x \fB\(->\fI Prints "a"\fR
+puts $y \fB\(->\fI Prints "b"\fR
+puts $z \fB\(->\fI Prints "c"\fR
-lassign {d e} x y z ;# Empty return
-puts $x ;# Prints "d"
-puts $y ;# Prints "e"
-puts $z ;# Prints ""
+lassign {d e} x y z \fB\(->\fI Empty return\fR
+puts $x \fB\(->\fI Prints "d"\fR
+puts $y \fB\(->\fI Prints "e"\fR
+puts $z \fB\(->\fI Prints ""\fR
-lassign {f g h i} x y ;# Returns "h i"
-puts $x ;# Prints "f"
-puts $y ;# Prints "g"
+lassign {f g h i} x y \fB\(->\fI Returns "h i"\fR
+puts $x \fB\(->\fI Prints "f"\fR
+puts $y \fB\(->\fI Prints "g"\fR
.CE
+.PP
The \fBlassign\fR command has other uses. It can be used to create
-the analogue of the "shift" command in many shell languages like this:
+the analogue of the
+.QW shift
+command in many shell languages like this:
.CS
set ::argv [lassign $::argv argumentToReadOff]
.CE
.SH "SEE ALSO"
lindex(n), list(n), lset(n), set(n)
-
.SH KEYWORDS
assign, element, list, multiple, set, variable
diff --git a/doc/lindex.n b/doc/lindex.n
index b99427e..f8f1e40 100644
--- a/doc/lindex.n
+++ b/doc/lindex.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: lindex.n,v 1.12 2006/11/15 09:23:01 dkf Exp $
+'\" RCS: @(#) $Id: lindex.n,v 1.13 2007/10/25 09:25:27 dkf Exp $
'\"
.so man.macros
.TH lindex n 8.4 Tcl "Tcl Built-In Commands"
@@ -67,17 +67,20 @@ is synonymous with
lindex [lindex [lindex $a 1] 2] 3
.CE
.SH EXAMPLES
+.PP
+Demonstrating how the index list system works.
.CS
-\fBlindex\fR {a b c} \fI=> a b c\fR
-\fBlindex\fR {a b c} {} \fI=> a b c\fR
-\fBlindex\fR {a b c} 0 \fI=> a\fR
-\fBlindex\fR {a b c} 2 \fI=> c\fR
-\fBlindex\fR {a b c} end \fI=> c\fR
-\fBlindex\fR {a b c} end-1 \fI=> b\fR
-\fBlindex\fR {{a b c} {d e f} {g h i}} 2 1 \fI=> h\fR
-\fBlindex\fR {{a b c} {d e f} {g h i}} {2 1} \fI=> h\fR
-\fBlindex\fR {{{a b} {c d}} {{e f} {g h}}} 1 1 0 \fI=> g\fR
-\fBlindex\fR {{{a b} {c d}} {{e f} {g h}}} {1 1 0} \fI=> g\fR
+.ta 5i
+\fBlindex\fR {a b c} \fB\(->\fI a b c\fR
+\fBlindex\fR {a b c} {} \fB\(->\fI a b c\fR
+\fBlindex\fR {a b c} 0 \fB\(->\fI a\fR
+\fBlindex\fR {a b c} 2 \fB\(->\fI c\fR
+\fBlindex\fR {a b c} end \fB\(->\fI c\fR
+\fBlindex\fR {a b c} end-1 \fB\(->\fI b\fR
+\fBlindex\fR {{a b c} {d e f} {g h i}} 2 1 \fB\(->\fI h\fR
+\fBlindex\fR {{a b c} {d e f} {g h i}} {2 1} \fB\(->\fI h\fR
+\fBlindex\fR {{{a b} {c d}} {{e f} {g h}}} 1 1 0 \fB\(->\fI g\fR
+\fBlindex\fR {{{a b} {c d}} {{e f} {g h}}} {1 1 0} \fB\(->\fI g\fR
.CE
.SH "SEE ALSO"
list(n), lappend(n), linsert(n), llength(n), lsearch(n),
@@ -85,6 +88,5 @@ lset(n), lsort(n), lrange(n), lreplace(n),
.VS 8.5
string(n)
.VE
-
.SH KEYWORDS
element, index, list
diff --git a/doc/lrepeat.n b/doc/lrepeat.n
index 4bda99c..4b1ebce 100644
--- a/doc/lrepeat.n
+++ b/doc/lrepeat.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: lrepeat.n,v 1.2 2006/11/15 09:23:01 dkf Exp $
+'\" RCS: @(#) $Id: lrepeat.n,v 1.3 2007/10/25 09:25:27 dkf Exp $
'\"
.so man.macros
.TH lrepeat n 8.5 Tcl "Tcl Built-In Commands"
@@ -17,18 +17,23 @@ lrepeat \- Build a list by repeating elements
.BE
.SH DESCRIPTION
.PP
-The \fBlrepeat\fR command creates a list of size \fInumber * number of
-elements\fR by repeating \fInumber\fR times the sequence of elements
-\fIelement1 element2 ...\fR. \fInumber\fR must be a positive integer,
-\fIelementn\fR can be any Tcl value. Note that \fBlrepeat 1 arg ...\fR
-is identical to \fBlist arg ...\fR, though the \fIarg\fR is required
-with \fBlrepeat\fR.
+The \fBlrepeat\fR command creates a list of size \fInumber\fR \(mu \fInumber
+of elements\fR by repeating \fInumber\fR times the sequence of elements
+\fIelement1 element2 ...\fR. The \fInumber\fR must be a positive integer, and
+each \fIelementN\fR can be any Tcl value.
+.PP
+Note that
+.QW "\fBlrepeat 1 arg ...\fR"
+is identical to
+.QW "\fBlist arg ...\fR" ,
+though the \fIarg\fR is required with \fBlrepeat\fR.
.SH EXAMPLES
.CS
-lrepeat 3 a => a a a
-lrepeat 3 [lrepeat 3 0] => {0 0 0} {0 0 0} {0 0 0}
-lrepeat 3 a b c => a b c a b c a b c
-lrepeat 3 [lrepeat 2 a] b c => {a a} b c {a a} b c {a a} b c
+.ta 3i
+lrepeat 3 a \fB\(->\fI a a a\fR
+lrepeat 3 [lrepeat 3 0] \fB\(->\fI {0 0 0} {0 0 0} {0 0 0}\fR
+lrepeat 3 a b c \fB\(->\fI a b c a b c a b c\fR
+lrepeat 3 [lrepeat 2 a] b c \fB\(->\fI {a a} b c {a a} b c {a a} b c\fR
.CE
.SH "SEE ALSO"
list(n), lappend(n), linsert(n), llength(n), lset(n)
diff --git a/doc/lreverse.n b/doc/lreverse.n
index 932b2d9..e0d53c8 100644
--- a/doc/lreverse.n
+++ b/doc/lreverse.n
@@ -1,15 +1,15 @@
-'\" -*- nroff -*-
-'\" Copyright (c) 2006 by Donal K. Fellows. All rights reserved.
-'\"
-'\" See the file "license.terms" for information on usage and redistribution
-'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-'\"
-'\" RCS: @(#) $Id: lreverse.n,v 1.2 2006/11/15 09:23:02 dkf Exp $
-'\"
+.\" -*- nroff -*-
+.\" Copyright (c) 2006 by Donal K. Fellows. All rights reserved.
+.\"
+.\" See the file "license.terms" for information on usage and redistribution
+.\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+.\"
+.\" RCS: @(#) $Id: lreverse.n,v 1.3 2007/10/25 09:25:27 dkf Exp $
+.\"
.so man.macros
.TH lreverse n 8.5 Tcl "Tcl Built-In Commands"
.BS
-'\" Note: do not modify the .SH NAME line immediately below!
+.\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
lreverse \- Reverse the order of a list
.SH SYNOPSIS
@@ -21,11 +21,11 @@ The \fBlreverse\fR command returns a list that has the same elements as its
input list, \fIlist\fR, except with the elements in the reverse order.
.SH EXAMPLES
.CS
-\fBlreverse\fR {a a b c} => c b a a
-\fBlreverse\fR {a b {c d} e f} => f e {c d} b a
+.ta 3i
+\fBlreverse\fR {a a b c} \fB\(->\fI c b a a\fR
+\fBlreverse\fR {a b {c d} e f} \fB\(->\fI f e {c d} b a\fR
.CE
.SH "SEE ALSO"
list(n), lsearch(n), lsort(n)
-
.SH KEYWORDS
element, list, reverse
diff --git a/doc/lsearch.n b/doc/lsearch.n
index 21c8680..1d382f3 100644
--- a/doc/lsearch.n
+++ b/doc/lsearch.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: lsearch.n,v 1.27 2007/09/02 22:37:41 dkf Exp $
+'\" RCS: @(#) $Id: lsearch.n,v 1.28 2007/10/25 09:25:27 dkf Exp $
'\"
.so man.macros
.TH lsearch n 8.5 Tcl "Tcl Built-In Commands"
@@ -18,7 +18,6 @@ lsearch \- See if a list contains a particular element
.SH SYNOPSIS
\fBlsearch \fR?\fIoptions\fR? \fIlist pattern\fR
.BE
-
.SH DESCRIPTION
.PP
This command searches the elements of \fIlist\fR to see if one
@@ -34,19 +33,23 @@ is \fB\-glob\fR. If more than one matching style is specified, the
last matching style given takes precedence.
.TP
\fB\-exact\fR
+.
\fIPattern\fR is a literal string that is compared for exact equality
against each list element.
.TP
\fB\-glob\fR
+.
\fIPattern\fR is a glob-style pattern which is matched against each list
element using the same rules as the \fBstring match\fR command.
.TP
\fB\-regexp\fR
+.
\fIPattern\fR is treated as a regular expression and matched against
each list element using the rules described in the \fBre_syntax\fR
reference page.
.TP
\fB\-sorted\fR
+.
The list elements are in sorted order. If this option is specified,
\fBlsearch\fR will use a more efficient searching algorithm to search
\fIlist\fR. If no other options are specified, \fIlist\fR is assumed
@@ -65,15 +68,18 @@ indices will be in numeric order. If values are returned, the order of the
values will be the order of those values within the input \fIlist\fR.
.TP
\fB\-inline\fR
+.
The matching value is returned instead of its index (or an empty
string if no value matches.) If \fB\-all\fR is also specified, then
the result of the command is the list of all values that matched.
.TP
\fB\-not\fR
+.
This negates the sense of the match, returning the index of the first
non-matching value in the list.
.TP
\fB\-start\fR\0\fIindex\fR
+.
The list is searched starting at position \fIindex\fR.
.VS 8.5
The interpretation of the \fIindex\fR value is the same as
@@ -87,10 +93,12 @@ and \fB\-sorted\fR options. If more than one is specified, the last
one takes precedence. The default is \fB\-ascii\fR.
.TP
\fB\-ascii\fR
+.
The list elements are to be examined as Unicode strings (the name is
for backward-compatibility reasons.)
.TP
\fB\-dictionary\fR
+.
The list elements are to be compared using dictionary-style
comparisons (see \fBlsort\fR for a fuller description). Note that this
only makes a meaningful difference from the \fB\-ascii\fR option when
@@ -98,16 +106,19 @@ the \fB\-sorted\fR option is given, because values are only
dictionary-equal when exactly equal.
.TP
\fB\-integer\fR
+.
The list elements are to be compared as integers.
.VS 8.5
.TP
\fB\-nocase\fR
+.
Causes comparisons to be handled in a case-insensitive manner. Has no
effect if combined with the \fB\-dictionary\fR, \fB\-integer\fR, or
\fB\-real\fR options.
.VE 8.5
.TP
\fB\-real\fR
+.
The list elements are to be compared as floating-point values.
.SS "SORTED LIST OPTIONS"
These options (only meaningful with the \fB\-sorted\fR option) specify
@@ -115,10 +126,12 @@ how the list is sorted. If more than one is given, the last one takes
precedence. The default option is \fB\-increasing\fR.
.TP
\fB\-decreasing\fR
+.
The list elements are sorted in decreasing order. This option is only
meaningful when used with \fB\-sorted\fR.
.TP
\fB\-increasing\fR
+.
The list elements are sorted in increasing order. This option is only
meaningful when used with \fB\-sorted\fR.
.SS "NESTED LIST OPTIONS"
@@ -127,12 +140,14 @@ These options are used to search lists of lists. They may be used
with any other options.
.TP
\fB\-index\fR\0\fIindexList\fR
+.
This option is designed for use when searching within nested lists.
The \fIindexList\fR argument gives a path of indices (much as might be
used with the \fBlindex\fR or \fBlset\fR commands) within each element
to allow the location of the term being matched against.
.TP
\fB\-subindices\fR
+.
If this option is given, the index result from this command (or every
index result when \fB\-all\fR is also specified) will be a complete
path (suitable for use with \fBlindex\fR or \fBlset\fR) within the
@@ -142,52 +157,55 @@ overall list to the term found. This option has no effect unless the
.SH EXAMPLES
Basic searching:
.CS
+.ta 2i
\fBlsearch\fR {a b c d e} c
- => 2
+ \fB\(->\fI 2\fR
\fBlsearch\fR -all {a b c a b c} c
- => 2 5
+ \fB\(->\fI 2 5\fR
.CE
-
+.PP
Using \fBlsearch\fR to filter lists:
.CS
+.ta 2i
\fBlsearch\fR -inline {a20 b35 c47} b*
- => b35
+ \fB\(->\fI b35\fR
\fBlsearch\fR -inline -not {a20 b35 c47} b*
- => a20
+ \fB\(->\fI a20\fR
\fBlsearch\fR -all -inline -not {a20 b35 c47} b*
- => a20 c47
+ \fB\(->\fI a20 c47\fR
\fBlsearch\fR -all -not {a20 b35 c47} b*
- => 0 2
+ \fB\(->\fI 0 2\fR
.CE
-This can even do a "set-like" removal operation:
+This can even do a
+.QW set-like
+removal operation:
.CS
+.ta 2i
\fBlsearch\fR -all -inline -not -exact {a b c a d e a f g a} a
- => b c d e f g
+ \fB\(->\fI b c d e f g\fR
.CE
-
+.PP
Searching may start part-way through the list:
.CS
+.ta 2i
\fBlsearch\fR -start 3 {a b c a b c} c
- => 5
+ \fB\(->\fI 5\fR
.CE
-
+.PP
It is also possible to search inside elements:
.CS
+.ta 2i
\fBlsearch\fR -index 1 -all -inline {{a abc} {b bcd} {c cde}} *bc*
- => {a abc} {b bcd}
+ \fB\(->\fI {a abc} {b bcd}\fR
.CE
-
.SH "SEE ALSO"
foreach(n), list(n), lappend(n), lindex(n), linsert(n), llength(n),
lset(n), lsort(n), lrange(n), lreplace(n),
.VS 8.5
string(n)
.VE
-
-
.SH KEYWORDS
list, match, pattern, regular expression, search, string
-
-'\" Local Variables:
-'\" mode: nroff
-'\" End:
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/doc/lset.n b/doc/lset.n
index 00f758d..7b7889f 100755
--- a/doc/lset.n
+++ b/doc/lset.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: lset.n,v 1.10 2007/10/24 14:29:38 dkf Exp $
+'\" RCS: @(#) $Id: lset.n,v 1.11 2007/10/25 09:25:27 dkf Exp $
'\"
.so man.macros
.TH lset n 8.4 Tcl "Tcl Built-In Commands"
@@ -79,33 +79,37 @@ of a list. If an index is outside the permitted range, an error is reported.
.SH EXAMPLES
In each of these examples, the initial value of \fIx\fR is:
.CS
+.ta 2i
set x [list [list a b c] [list d e f] [list g h i]]
- => {a b c} {d e f} {g h i}
+ \fB\(->\fR {a b c} {d e f} {g h i}
.CE
The indicated return value also becomes the new value of \fIx\fR
(except in the last case, which is an error which leaves the value of
\fIx\fR unchanged.)
.CS
-lset x {j k l} => j k l
-lset x {} {j k l} => j k l
-lset x 0 j => j {d e f} {g h i}
-lset x 2 j => {a b c} {d e f} j
-lset x end j => {a b c} {d e f} j
-lset x end-1 j => {a b c} j {g h i}
-lset x 2 1 j => {a b c} {d e f} {g j i}
-lset x {2 1} j => {a b c} {d e f} {g j i}
-lset x {2 3} j => \fIlist index out of range\fR
+.ta 2i
+lset x {j k l} \fB\(->\fR j k l
+lset x {} {j k l} \fB\(->\fR j k l
+lset x 0 j \fB\(->\fR j {d e f} {g h i}
+lset x 2 j \fB\(->\fR {a b c} {d e f} j
+lset x end j \fB\(->\fR {a b c} {d e f} j
+lset x end-1 j \fB\(->\fR {a b c} j {g h i}
+lset x 2 1 j \fB\(->\fR {a b c} {d e f} {g j i}
+lset x {2 1} j \fB\(->\fR {a b c} {d e f} {g j i}
+lset x {2 3} j \fB\(->\fR \fIlist index out of range\fR
.CE
In the following examples, the initial value of \fIx\fR is:
.CS
+.ta 2i
set x [list [list [list a b] [list c d]] \e
[list [list e f] [list g h]]]
- => {{a b} {c d}} {{e f} {g h}}
+ \fB\(->\fR {{a b} {c d}} {{e f} {g h}}
.CE
The indicated return value also becomes the new value of \fIx\fR.
.CS
-lset x 1 1 0 j => {{a b} {c d}} {{e f} {j h}}
-lset x {1 1 0} j => {{a b} {c d}} {{e f} {j h}}
+.ta 2i
+lset x 1 1 0 j \fB\(->\fR {{a b} {c d}} {{e f} {j h}}
+lset x {1 1 0} j \fB\(->\fR {{a b} {c d}} {{e f} {j h}}
.CE
.SH "SEE ALSO"
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
diff --git a/doc/regexp.n b/doc/regexp.n
index 99e75f3..4aa88e2 100644
--- a/doc/regexp.n
+++ b/doc/regexp.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: regexp.n,v 1.20 2007/10/24 14:29:39 dkf Exp $
+'\" RCS: @(#) $Id: regexp.n,v 1.21 2007/10/25 09:25:27 dkf Exp $
'\"
.so man.macros
.TH regexp n 8.3 Tcl "Tcl Built-In Commands"
@@ -114,12 +114,15 @@ list will be concatenated at each iteration, such that a flat list is
always returned. For each match iteration, the command will append the
overall match data, plus one element for each subexpression in the
regular expression. Examples are:
+.RS
.CS
- regexp -inline -- {\\w(\\w)} " inlined "
- => {in n}
- regexp -all -inline -- {\\w(\\w)} " inlined "
- => {in n li i ne e}
+.ta 2i
+\fBregexp\fR -inline -- {\\w(\\w)} " inlined "
+ \fB\(->\fI in n\fR
+\fBregexp\fR -all -inline -- {\\w(\\w)} " inlined "
+ \fB\(->\fI in n li i ne e\fR
.CE
+.RE
.TP 15
\fB\-start\fR \fIindex\fR
Specifies a character index offset into the string to start
diff --git a/doc/split.n b/doc/split.n
index 1333716..c41aada 100644
--- a/doc/split.n
+++ b/doc/split.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: split.n,v 1.5 2004/10/27 14:24:37 dkf Exp $
+'\" RCS: @(#) $Id: split.n,v 1.6 2007/10/25 09:25:27 dkf Exp $
'\"
.so man.macros
.TH split n "" Tcl "Tcl Built-In Commands"
@@ -16,7 +16,6 @@ split \- Split a string into a proper Tcl list
.SH SYNOPSIS
\fBsplit \fIstring \fR?\fIsplitChars\fR?
.BE
-
.SH DESCRIPTION
.PP
Returns a list created by splitting \fIstring\fR at each character
@@ -33,28 +32,32 @@ If \fIsplitChars\fR is an empty string then each character of
.SH EXAMPLES
Divide up a USENET group name into its hierarchical components:
.CS
+.ta 2i
\fBsplit\fR "comp.lang.tcl.announce" .
- \fI=> comp lang tcl announce\fR
+ \fB\(->\fI comp lang tcl announce\fR
.CE
.PP
See how the \fBsplit\fR command splits on \fIevery\fR character in
\fIsplitChars\fR, which can result in information loss if you are not
careful:
.CS
+.ta 2i
\fBsplit\fR "alpha beta gamma" "temp"
- \fI=> al {ha b} {} {a ga} {} a\fR
+ \fB\(->\fI al {ha b} {} {a ga} {} a\fR
.CE
.PP
Extract the list words from a string that is not a well-formed list:
.CS
+.ta 2i
\fBsplit\fR "Example with {unbalanced brace character"
- \fI=> Example with \\{unbalanced brace character\fR
+ \fB\(->\fI Example with \\{unbalanced brace character\fR
.CE
.PP
Split a string into its constituent characters
.CS
+.ta 2i
\fBsplit\fR "Hello world" {}
- \fI=> H e l l o { } w o r l d\fR
+ \fB\(->\fI H e l l o { } w o r l d\fR
.CE
.SS "PARSING RECORD-ORIENTED FILES"
Parse a Unix /etc/passwd file, which consists of one entry per line,
@@ -80,9 +83,7 @@ foreach rec $records {
puts "$longName uses [file tail $shell] for a login shell"
}
.CE
-
.SH "SEE ALSO"
join(n), list(n), string(n)
-
.SH KEYWORDS
list, split, string