diff options
Diffstat (limited to 'doc/lrange.n')
-rw-r--r-- | doc/lrange.n | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/doc/lrange.n b/doc/lrange.n index 5b0d187..34f0150 100644 --- a/doc/lrange.n +++ b/doc/lrange.n @@ -1,7 +1,7 @@ '\" '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 2001 Kevin B. Kenny. All rights reserved. +'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -21,18 +21,24 @@ lrange \- Return one or more adjacent elements from a list \fIList\fR must be a valid Tcl list. This command will return a new list consisting of elements \fIfirst\fR through \fIlast\fR, inclusive. -\fIFirst\fR or \fIlast\fR -may be \fBend\fR (or any abbreviation of it) to refer to the last -element of the list. +.VS 8.5 +The index values \fIfirst\fR and \fIlast\fR are interpreted +the same as index values for the command \fBstring index\fR, +supporting simple index arithmetic and indices relative to the +end of the list. +.VE If \fIfirst\fR is less than zero, it is treated as if it were zero. If \fIlast\fR is greater than or equal to the number of elements in the list, then it is treated as if it were \fBend\fR. If \fIfirst\fR is greater than \fIlast\fR then an empty string is returned. -Note: ``\fBlrange \fIlist first first\fR'' does not always produce the -same result as ``\fBlindex \fIlist first\fR'' (although it often does -for simple fields that aren't enclosed in braces); it does, however, -produce exactly the same results as ``\fBlist [lindex \fIlist first\fB]\fR'' +Note: +.QW "\fBlrange \fIlist first first\fR" +does not always produce the same result as +.QW "\fBlindex \fIlist first\fR" +(although it often does for simple fields that are not enclosed in +braces); it does, however, produce exactly the same results as +.QW "\fBlist [lindex \fIlist first\fB]\fR" .SH EXAMPLES Selecting the first two elements: .CS @@ -64,9 +70,10 @@ elements to .CE .SH "SEE ALSO" -.VS 8.4 list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), -lset(n), lreplace(n), lsort(n) +lset(n), lreplace(n), lsort(n), +.VS 8.5 +string(n) .VE .SH KEYWORDS |