lrepeat - Build a list by repeating elements
lrepeat count ?element ...?
lrepeat(1t) Tcl Built-In Commands lrepeat(1t)
______________________________________________________________________________
NAME
lrepeat - Build a list by repeating elements
SYNOPSIS
lrepeat count ?element ...?
______________________________________________________________________________
DESCRIPTION
The lrepeat command creates a list of size count * number of elements
by repeating count times the sequence of elements element .... count
must be a non-negative integer, element can be any Tcl value. Note
that lrepeat 1 element ... is identical to list element ....
EXAMPLES
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
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
+---------------+------------------+
|ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+---------------+------------------+
|Availability | runtime/tcl-8 |
+---------------+------------------+
|Stability | Uncommitted |
+---------------+------------------+
SEE ALSO
list(n), lappend(n), linsert(n), llength(n), lset(n)
KEYWORDS
element, index, list
NOTES
Source code for open source software components in Oracle Solaris can
be found at https://www.oracle.com/downloads/opensource/solaris-source-
code-downloads.html.
This software was built from source available at
https://github.com/oracle/solaris-userland. The original community
source was downloaded from http://prdownloads.sourceforge.net/tcl/tcl-
core8.6.7-src.tar.gz.
Further information about this software can be found on the open source
community website at https://www.tcl.tk/.
Tcl 8.5 lrepeat(1t)