diff options
Diffstat (limited to 'doc/lset.n')
-rwxr-xr-x | doc/lset.n | 32 |
1 files changed, 18 insertions, 14 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.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), |