summaryrefslogtreecommitdiffstats
path: root/doc/switch.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2006-08-09 10:06:28 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2006-08-09 10:06:28 (GMT)
commit99218e86bcf6d184ccf51155c312d298a5d82b07 (patch)
treee3746121f114a149427f88ebfe84850a5ae43702 /doc/switch.n
parenta15358050ba135ab39f8fa94adbd1584fb657ffa (diff)
downloadtcl-99218e86bcf6d184ccf51155c312d298a5d82b07.zip
tcl-99218e86bcf6d184ccf51155c312d298a5d82b07.tar.gz
tcl-99218e86bcf6d184ccf51155c312d298a5d82b07.tar.bz2
Make [expr] use in examples more idiomatic [Bug 1526581]
Diffstat (limited to 'doc/switch.n')
-rw-r--r--doc/switch.n16
1 files changed, 8 insertions, 8 deletions
diff --git a/doc/switch.n b/doc/switch.n
index 83103cb..bcab863 100644
--- a/doc/switch.n
+++ b/doc/switch.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: switch.n,v 1.9 2005/06/01 11:00:33 dkf Exp $
+'\" RCS: @(#) $Id: switch.n,v 1.10 2006/08/09 10:06:28 dkf Exp $
'\"
.so man.macros
.TH switch n 8.5 Tcl "Tcl Built-In Commands"
@@ -117,7 +117,7 @@ The \fBswitch\fR command can match against variables and not just
literals, as shown here (the result is \fI2\fR):
.CS
set foo "abc"
-\fBswitch\fR abc a \- b {expr 1} $foo {expr 2} default {expr 3}
+\fBswitch\fR abc a \- b {expr {1}} $foo {expr {2}} default {expr {3}}
.CE
.PP
Using glob matching and the fall-through body is an alternative to
@@ -126,9 +126,9 @@ writing regular expressions with alternations, as can be seen here
.CS
\fBswitch\fR \-glob aaab {
a*b \-
- b {expr 1}
- a* {expr 2}
- default {expr 3}
+ b {expr {1}}
+ a* {expr {2}}
+ default {expr {3}}
}
.CE
.PP
@@ -139,13 +139,13 @@ last) is taken. This example has a result of \fI3\fR:
a \-
b {
# Correct Comment Placement
- expr 1
+ expr {1}
}
c {
- expr 2
+ expr {2}
}
default {
- expr 3
+ expr {3}
}
}
.CE