summaryrefslogtreecommitdiffstats
path: root/doc/lsearch.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2018-11-06 10:04:02 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2018-11-06 10:04:02 (GMT)
commit179e8f4df7568f6aca6e53525abfe0505fd2a578 (patch)
treec9328ec8e0afd8af8a96b9f3da12b152cec7c281 /doc/lsearch.n
parentc5a85dbfdc7dce9328b7f5fffb0bae519f68cf9f (diff)
parent2798a075ee62ea5ab4aa80279d614a8634ba378a (diff)
downloadtcl-179e8f4df7568f6aca6e53525abfe0505fd2a578.zip
tcl-179e8f4df7568f6aca6e53525abfe0505fd2a578.tar.gz
tcl-179e8f4df7568f6aca6e53525abfe0505fd2a578.tar.bz2
merge core-8-branch
Diffstat (limited to 'doc/lsearch.n')
-rw-r--r--doc/lsearch.n20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/lsearch.n b/doc/lsearch.n
index c2644b8..12c2786 100644
--- a/doc/lsearch.n
+++ b/doc/lsearch.n
@@ -148,6 +148,19 @@ or \fB\-not\fR.
These options are used to search lists of lists. They may be used
with any other options.
.TP
+\fB\-stride\0\fIstrideLength\fR
+.
+If this option is specified, the list is treated as consisting of
+groups of \fIstrideLength\fR elements and the groups are searched by
+either their first element or, if the \fB\-index\fR option is used,
+by the element within each group given by the first index passed to
+\fB\-index\fR (which is then ignored by \fB\-index\fR). The resulting
+index always points to the first element in a group.
+.PP
+The list length must be an integer multiple of \fIstrideLength\fR, which
+in turn must be at least 1. A \fIstrideLength\fR of 1 is the default and
+indicates no grouping.
+.TP
\fB\-index\fR\0\fIindexList\fR
.
This option is designed for use when searching within nested lists.
@@ -208,6 +221,13 @@ It is also possible to search inside elements:
\fBlsearch\fR -index 1 -all -inline {{a abc} {b bcd} {c cde}} *bc*
\fI\(-> {a abc} {b bcd}\fR
.CE
+.PP
+The same thing for a flattened list:
+.PP
+.CS
+\fBlsearch\fR -stride 2 -index 1 -all -inline {a abc b bcd c cde} *bc*
+ \fI\(-> {a abc b bcd}\fR
+.CE
.SH "SEE ALSO"
foreach(n), list(n), lappend(n), lindex(n), linsert(n), llength(n),
lset(n), lsort(n), lrange(n), lreplace(n),