summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-03-17 00:57:19 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-03-17 00:57:19 (GMT)
commitb07cf17d9c57bb355e84b17470235902854c7d40 (patch)
tree24e61dab0ac7231432c6bbcb7221ea0fc959b0c6
parent7f955ebb347697e3262c2bf5469bd7552e4bda57 (diff)
downloadtcl-b07cf17d9c57bb355e84b17470235902854c7d40.zip
tcl-b07cf17d9c57bb355e84b17470235902854c7d40.tar.gz
tcl-b07cf17d9c57bb355e84b17470235902854c7d40.tar.bz2
Slightly better docs for [lsearch]'s advanced capabilities
-rw-r--r--ChangeLog6
-rw-r--r--doc/lsearch.n11
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3decacb..d94112d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-03-17 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/lsearch.n: Improved examples on the advanced capabilities of
+ lsearch (with the right options, set element removal can be done)
+ following discussion on tkchat.
+
2004-03-16 Don Porter <dgp@users.sourceforge.net>
* doc/catch.n: Compiled [catch] no longer fails to catch syntax
diff --git a/doc/lsearch.n b/doc/lsearch.n
index b2129aa..74e8451 100644
--- a/doc/lsearch.n
+++ b/doc/lsearch.n
@@ -6,7 +6,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: lsearch.n,v 1.15 2003/10/14 13:38:57 dkf Exp $
+'\" RCS: @(#) $Id: lsearch.n,v 1.16 2004/03/17 00:57:20 dkf Exp $
'\"
.so man.macros
.TH lsearch n 8.5 Tcl "Tcl Built-In Commands"
@@ -124,11 +124,20 @@ precedence.
.CS
lsearch {a b c d e} c => 2
lsearch -all {a b c a b c} c => 2 5
+
+\fI# Filtering examples\fR
lsearch -inline {a20 b35 c47} b* => b35
lsearch -inline -not {a20 b35 c47} b* => a20
lsearch -all -inline -not {a20 b35 c47} b* => a20 c47
lsearch -all -not {a20 b35 c47} b* => 0 2
+\fI# Simple set removal\fR
+lsearch -all -inline -not -exact {a b c a d e a f g a} a
+ => b c d e f g
+
+\fI# Non-start based searches\fR
lsearch -start 3 {a b c a b c} c => 5
+
+\fI# Searching inside elements\fR
lsearch -index 1 -all {{a abc} {b bcd} {c cde}} *bc* => {a abc} {b bcd}
.CE