summaryrefslogtreecommitdiffstats
path: root/doc/upvar.n
diff options
context:
space:
mode:
authordas <das>2004-11-12 09:01:22 (GMT)
committerdas <das>2004-11-12 09:01:22 (GMT)
commit32881d222bd536bdbf64ad2faf3deb6bb1f34aca (patch)
tree1c6463dd66e2fd05e6f2a96516a458e646c8d56c /doc/upvar.n
parent0b20aa92ea2230773776adc69fe0a473b7bfef88 (diff)
downloadtcl-32881d222bd536bdbf64ad2faf3deb6bb1f34aca.zip
tcl-32881d222bd536bdbf64ad2faf3deb6bb1f34aca.tar.gz
tcl-32881d222bd536bdbf64ad2faf3deb6bb1f34aca.tar.bz2
* doc/CrtChannel.3:
* doc/Interp.3: * doc/Limit.3: * doc/binary.n: * doc/dict.n: * doc/tm.n: * doc/upvar.n: fixed *roff errors uncovered by running 'make html'. * tools/tcltk-man2html.tcl: added faked support for bullet point lists, i.e. *nroff ".IP \(bu" syntax.
Diffstat (limited to 'doc/upvar.n')
-rw-r--r--doc/upvar.n18
1 files changed, 9 insertions, 9 deletions
diff --git a/doc/upvar.n b/doc/upvar.n
index 8cc28a6..145adf9 100644
--- a/doc/upvar.n
+++ b/doc/upvar.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: upvar.n,v 1.8 2004/10/27 14:43:54 dkf Exp $
+'\" RCS: @(#) $Id: upvar.n,v 1.9 2004/11/12 09:01:25 das Exp $
'\"
.so man.macros
.TH upvar n "" Tcl "Tcl Built-In Commands"
@@ -46,12 +46,12 @@ procedure calling and also makes it easier to build new control constructs
as Tcl procedures.
For example, consider the following procedure:
.CS
-\fBproc add2 name {
+proc \fBadd2\fR name {
\fBupvar\fR $name x
set x [expr $x+2]
-}\fR
+}
.CE
-\fBAdd2\fR is invoked with an argument giving the name of a variable,
+\fBadd2\fR is invoked with an argument giving the name of a variable,
and it adds two to the value of that variable.
Although \fBadd2\fR could have been implemented using \fBuplevel\fR
instead of \fBupvar\fR, \fBupvar\fR makes it simpler for \fBadd2\fR
@@ -84,17 +84,17 @@ the trace procedure will be passed the name of \fImyVar\fR, rather
than the name of \fIotherVar\fR. Thus, the output of the following code
will be \fBlocalVar\fR rather than \fBoriginalVar\fR:
.CS
-\fBproc traceproc { name index op } {
+proc \fBtraceproc\fR { name index op } {
puts $name
}
-proc setByUpvar { name value } {
+proc \fBsetByUpvar\fR { name value } {
\fBupvar\fR $name localVar
set localVar $value
}
set originalVar 1
-trace variable originalVar w traceproc
-setByUpvar originalVar 2
-}\fR
+trace variable originalVar w \fBtraceproc\fR
+\fBsetByUpvar\fR originalVar 2
+}
.CE
.PP
If \fIotherVar\fR refers to an element of an array, then variable