diff options
Diffstat (limited to 'doc/lset.n')
-rwxr-xr-x | doc/lset.n | 34 |
1 files changed, 16 insertions, 18 deletions
@@ -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.11 2007/10/25 09:25:27 dkf Exp $ +'\" RCS: @(#) $Id: lset.n,v 1.12 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH lset n 8.4 Tcl "Tcl Built-In Commands" @@ -79,37 +79,33 @@ 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]] - \fB\(->\fR {a b c} {d e f} {g h i} + => {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 -.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 +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 .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]]] - \fB\(->\fR {{a b} {c d}} {{e f} {g h}} + => {{a b} {c d}} {{e f} {g h}} .CE The indicated return value also becomes the new value of \fIx\fR. .CS -.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}} +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}} .CE .SH "SEE ALSO" list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), @@ -117,5 +113,7 @@ lsort(n), lrange(n), lreplace(n), .VS 8.5 string(n) .VE + + .SH KEYWORDS element, index, list, replace, set |