From a33eb678e592b4f802c15555558e1b609fc4a903 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 24 Aug 2004 08:59:52 +0000 Subject: Added clarifying note on [string map]'s behaviour. --- ChangeLog | 4 ++++ doc/string.n | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 870a399..43a556c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-08-24 Donal K. Fellows + + * doc/string.n: Added clarifying note. + 2004-08-23 Don Porter * library/auto.tcl: Updated [tcl_findLibrary] search path diff --git a/doc/string.n b/doc/string.n index 26d1b10..ff331b4 100644 --- a/doc/string.n +++ b/doc/string.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: string.n,v 1.20 2004/06/30 12:34:35 dkf Exp $ +'\" RCS: @(#) $Id: string.n,v 1.21 2004/08/24 08:59:54 dkf Exp $ '\" .so man.macros .TH string n 8.1 Tcl "Tcl Built-In Commands" @@ -194,6 +194,14 @@ will have no affect for later key matches. For example, \fBstring map {abc 1 ab 2 a 3 1 0} 1abcaababcabababc\fR .CE will return the string \fB01321221\fR. +.PP +Note that if an earlier \fIkey\fR is a prefix of a later one, it will +completely mask the later one. So if the previous example is +reordered like this, +.CS +\fBstring map {1 0 ab 2 a 3 abc 1} 1abcaababcabababc\fR +.CE +it will return the string \fB02c322c222c\fR. .RE .TP \fBstring match\fR ?\fB\-nocase\fR? \fIpattern\fR \fIstring\fR -- cgit v0.12