summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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