2 '\" Copyright (c) 2003 Simon Geard. All rights reserved.
4 '\" See the file "license.terms" for information on usage and redistribution
5 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7 .TH lrepeat n 8.5 Tcl "Tcl Built-In Commands"
10 '\" Note: do not modify the .SH NAME line immediately below!
12 lrepeat \- Build a list by repeating elements
14 \fBlrepeat \fIcount \fR?\fIelement ...\fR?
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.
27 \fBlrepeat\fR 3 [\fBlrepeat\fR 3 0]
28 \fI\(-> {0 0 0} {0 0 0} {0 0 0}\fR
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
35 list(n), lappend(n), linsert(n), llength(n), lset(n)