Unix and Linux Discussions Tagged with repeating |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
8 |
10,337 |
Shell Programming and Scripting |
|
|
|
7 |
3,552 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
2,083 |
Shell Programming and Scripting |
|
|
|
3 |
2,276 |
Shell Programming and Scripting |
|
|
|
0 |
1,372 |
OS X Support RSS |
|
|
|
7 |
15,768 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
4,300 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
4,248 |
Programming |
|
|
|
4 |
5,622 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
5,037 |
UNIX for Dummies Questions & Answers |
|
|
|
8 |
4,811 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,872 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,167 |
UNIX for Dummies Questions & Answers |
lrepeat(3tcl) Tcl Built-In Commands lrepeat(3tcl)
__________________________________________________________________________________________________________________________________________________
NAME
lrepeat - Build a list by repeating elements
SYNOPSIS
lrepeat number element1 ?element2 element3 ...?
_________________________________________________________________
DESCRIPTION
The lrepeat command creates a list of size number * number of elements by repeating number times the sequence of elements element1 element2
.... number must be a positive integer, elementn can be any Tcl value. Note that lrepeat 1 arg ... is identical to list arg ..., though
the arg is required with lrepeat.
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
SEE ALSO
list(3tcl), lappend(3tcl), linsert(3tcl), llength(3tcl), lset(3tcl)
KEYWORDS
element, index, list
Tcl 8.5 lrepeat(3tcl)