summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2019-03-30 12:54:52 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2019-03-30 12:54:52 (GMT)
commit3471a570b685e48a9da13cc60a506f175ba0283b (patch)
tree65edb5e64c3b00168500639909855b7770a1b46a
parent83f6cc3841131f68cf0b1b4bb410ce6b52157629 (diff)
downloadtcl-3471a570b685e48a9da13cc60a506f175ba0283b.zip
tcl-3471a570b685e48a9da13cc60a506f175ba0283b.tar.gz
tcl-3471a570b685e48a9da13cc60a506f175ba0283b.tar.bz2
Added documentation
-rw-r--r--doc/lrange.n2
-rw-r--r--doc/lremove.n55
-rw-r--r--doc/lreplace.n2
3 files changed, 57 insertions, 2 deletions
diff --git a/doc/lrange.n b/doc/lrange.n
index ba068f6..a4fd98b 100644
--- a/doc/lrange.n
+++ b/doc/lrange.n
@@ -72,7 +72,7 @@ elements to
.CE
.SH "SEE ALSO"
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
-lset(n), lreplace(n), lsort(n),
+lset(n), lremove(n), lreplace(n), lsort(n),
string(n)
.SH KEYWORDS
element, list, range, sublist
diff --git a/doc/lremove.n b/doc/lremove.n
new file mode 100644
index 0000000..b947863
--- /dev/null
+++ b/doc/lremove.n
@@ -0,0 +1,55 @@
+'\"
+'\" Copyright (c) 2019 Donal K. Fellows.
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+.TH lremove n 8.7 Tcl "Tcl Built-In Commands"
+.so man.macros
+.BS
+'\" Note: do not modify the .SH NAME line immediately below!
+.SH NAME
+lremove \- Remove elements from a list by index
+.SH SYNOPSIS
+\fBlremove \fIlist\fR ?\fIindex ...\fR?
+.BE
+.SH DESCRIPTION
+.PP
+\fBlremove\fR returns a new list formed by simultaneously removing zero or
+more elements of \fIlist\fR at each of the indices given by an arbirary number
+of \fIindex\fR arguments. The indices may be in any order and may be repeated;
+the element at index will only be removed once. The index values 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. 0 refers to the first element of the list, and \fBend\fR refers to the
+last element of the list.
+.SH EXAMPLES
+.PP
+Removing the third element of a list:
+.PP
+.CS
+% \fBlremove\fR {a b c d e} 2
+a b d e
+.CE
+.PP
+Removing two elements from a list:
+.PP
+.CS
+% \fBlremove\fR {a b c d e} end-1 1
+a c e
+.CE
+.PP
+Removing the same element indicated in two different ways:
+.PP
+.CS
+% \fBlremove\fR {a b c d e} 2 end-2
+a b d e
+.CE
+.SH "SEE ALSO"
+list(n), lrange(n), lsearch(n), lsearch(n)
+.SH KEYWORDS
+element, list, remove
+.\" Local variables:
+.\" mode: nroff
+.\" fill-column: 78
+.\" End:
diff --git a/doc/lreplace.n b/doc/lreplace.n
index 32b7356..68cddfe 100644
--- a/doc/lreplace.n
+++ b/doc/lreplace.n
@@ -96,7 +96,7 @@ a b c d e f g h i
.VE TIP505
.SH "SEE ALSO"
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
-lset(n), lrange(n), lsort(n),
+lset(n), lrange(n), lremove(n), lsort(n),
string(n)
.SH KEYWORDS
element, list, replace