| 1 |
'\" |
| 2 |
'\" Copyright (c) 2003 Simon Geard. All rights reserved. |
| 3 |
'\" |
| 4 |
'\" See the file "license.terms" for information on usage and redistribution |
| 5 |
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 6 |
'\" |
| 7 |
.TH lrepeat n 8.5 Tcl "Tcl Built-In Commands" |
| 8 |
.so man.macros |
| 9 |
.BS |
| 10 |
'\" Note: do not modify the .SH NAME line immediately below! |
| 11 |
.SH NAME |
| 12 |
lrepeat \- Build a list by repeating elements |
| 13 |
.SH SYNOPSIS |
| 14 |
\fBlrepeat \fIcount \fR?\fIelement ...\fR? |
| 15 |
.BE |
| 16 |
.SH DESCRIPTION |
| 17 |
.PP |
| 18 |
The \fBlrepeat\fR command creates a list of size \fIcount * number of |
| 19 |
elements\fR by repeating \fIcount\fR times the sequence of elements |
| 20 |
\fIelement ...\fR. \fIcount\fR must be a non-negative integer, |
| 21 |
\fIelement\fR can be any Tcl value. Note that \fBlrepeat 1 element ...\fR |
| 22 |
is identical to \fBlist element ...\fR. |
| 23 |
.SH EXAMPLES |
| 24 |
.CS |
| 25 |
\fBlrepeat\fR 3 a |
| 26 |
\fI\(-> a a a\fR |
| 27 |
\fBlrepeat\fR 3 [\fBlrepeat\fR 3 0] |
| 28 |
\fI\(-> {0 0 0} {0 0 0} {0 0 0}\fR |
| 29 |
\fBlrepeat\fR 3 a b c |
| 30 |
\fI\(-> a b c a b c a b c\fR |
| 31 |
\fBlrepeat\fR 3 [\fBlrepeat\fR 2 a] b c |
| 32 |
\fI\(-> {a a} b c {a a} b c {a a} b c\fR |
| 33 |
.CE |
| 34 |
.SH "SEE ALSO" |
| 35 |
list(n), lappend(n), linsert(n), llength(n), lset(n) |
| 36 |
|
| 37 |
.SH KEYWORDS |
| 38 |
element, index, list |