Unix and Linux Discussions Tagged with repeating |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
8 |
10,065 |
Shell Programming and Scripting |
|
|
|
7 |
3,385 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
2,039 |
Shell Programming and Scripting |
|
|
|
3 |
2,256 |
Shell Programming and Scripting |
|
|
|
0 |
1,360 |
OS X Support RSS |
|
|
|
7 |
15,739 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
4,286 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
4,128 |
Programming |
|
|
|
4 |
5,611 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
4,916 |
UNIX for Dummies Questions & Answers |
|
|
|
8 |
4,595 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,822 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,081 |
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)