OSDN Git Service

Updated to tcl 8.4.1
[pf3gnuchains/sourceware.git] / tcl / doc / lreplace.n
1 '\"
2 '\" Copyright (c) 1993 The Regents of the University of California.
3 '\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4 '\" Copyright (c) 2001 Kevin B. Kenny.  All rights reserved.
5 '\"
6 '\" See the file "license.terms" for information on usage and redistribution
7 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8 '\" 
9 '\" RCS: @(#) $Id$
10 '\" 
11 .so man.macros
12 .TH lreplace n 7.4 Tcl "Tcl Built-In Commands"
13 .BS
14 '\" Note:  do not modify the .SH NAME line immediately below!
15 .SH NAME
16 lreplace \- Replace elements in a list with new elements
17 .SH SYNOPSIS
18 \fBlreplace \fIlist first last \fR?\fIelement element ...\fR?
19 .BE
20
21 .SH DESCRIPTION
22 .PP
23 \fBlreplace\fR returns a new list formed by replacing one or more elements of
24 \fIlist\fR with the \fIelement\fR arguments.
25 \fIfirst\fR and \fIlast\fR specify the first and last index of the
26 range of elements to replace.  0 refers to the first element of the
27 list, and \fBend\fR (or any abbreviation of it) may be used to refer
28 to the last element of the list.  If \fIlist\fR is empty, then
29 \fIfirst\fR and \fIlast\fR are ignored.
30
31 If \fIfirst\fR is less than zero, it is considered to refer to the
32 first element of the list.  For non-empty lists, the element indicated
33 by \fIfirst\fR must exist.
34
35 If \fIlast\fR is less than zero but greater than \fIfirst\fR, then any
36 specified elements will be prepended to the list.  If \fIlast\fR is
37 less than \fIfirst\fR then no elements are deleted; the new elements
38 are simply inserted before \fIfirst\fR.
39
40 The \fIelement\fR arguments specify zero or more new arguments to
41 be added to the list in place of those that were deleted.
42 Each \fIelement\fR argument will become a separate element of
43 the list.  If no \fIelement\fR arguments are specified, then the elements
44 between \fIfirst\fR and \fIlast\fR are simply deleted.  If \fIlist\fR
45 is empty, any \fIelement\fR arguments are added to the end of the list.
46
47 .SH "SEE ALSO"
48 .VS 8.4
49 list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), 
50 lset(n), lrange(n), lsort(n)
51 .VE
52
53 .SH KEYWORDS
54 element, list, replace