Rev | Line | |
---|
[25] | 1 | '\" |
---|
| 2 | '\" Copyright (c) 2003 by 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 | '\" RCS: @(#) $Id: lrepeat.n,v 1.6 2007/12/13 15:22:32 dgp Exp $ |
---|
| 8 | '\" |
---|
| 9 | .so man.macros |
---|
| 10 | .TH lrepeat n 8.5 Tcl "Tcl Built-In Commands" |
---|
| 11 | .BS |
---|
| 12 | '\" Note: do not modify the .SH NAME line immediately below! |
---|
| 13 | .SH NAME |
---|
| 14 | lrepeat \- Build a list by repeating elements |
---|
| 15 | .SH SYNOPSIS |
---|
| 16 | \fBlrepeat \fInumber element1 \fR?\fIelement2 element3 ...\fR? |
---|
| 17 | .BE |
---|
| 18 | .SH DESCRIPTION |
---|
| 19 | .PP |
---|
| 20 | The \fBlrepeat\fR command creates a list of size \fInumber * number of |
---|
| 21 | elements\fR by repeating \fInumber\fR times the sequence of elements |
---|
| 22 | \fIelement1 element2 ...\fR. \fInumber\fR must be a positive integer, |
---|
| 23 | \fIelementn\fR can be any Tcl value. Note that \fBlrepeat 1 arg ...\fR |
---|
| 24 | is identical to \fBlist arg ...\fR, though the \fIarg\fR is required |
---|
| 25 | with \fBlrepeat\fR. |
---|
| 26 | .SH EXAMPLES |
---|
| 27 | .CS |
---|
| 28 | \fBlrepeat\fR 3 a |
---|
| 29 | \fI\(-> a a a\fR |
---|
| 30 | \fBlrepeat\fR 3 [\fBlrepeat\fR 3 0] |
---|
| 31 | \fI\(-> {0 0 0} {0 0 0} {0 0 0}\fR |
---|
| 32 | \fBlrepeat\fR 3 a b c |
---|
| 33 | \fI\(-> a b c a b c a b c\fR |
---|
| 34 | \fBlrepeat\fR 3 [\fBlrepeat\fR 2 a] b c |
---|
| 35 | \fI\(-> {a a} b c {a a} b c {a a} b c\fR |
---|
| 36 | .CE |
---|
| 37 | .SH "SEE ALSO" |
---|
| 38 | list(n), lappend(n), linsert(n), llength(n), lset(n) |
---|
| 39 | |
---|
| 40 | .SH KEYWORDS |
---|
| 41 | element, index, list |
---|
Note: See
TracBrowser
for help on using the repository browser.