diff options
author | das <das@noemail.net> | 2004-11-12 09:02:28 (GMT) |
---|---|---|
committer | das <das@noemail.net> | 2004-11-12 09:02:28 (GMT) |
commit | 344b1b937d1a871631547e9829f97cafb5ab56db (patch) | |
tree | 164cf4e58176c0a731e7347bb842051367e6dde6 /doc/upvar.n | |
parent | 995cb03bea86ad6e14997565325180da24d028af (diff) | |
download | tcl-344b1b937d1a871631547e9829f97cafb5ab56db.zip tcl-344b1b937d1a871631547e9829f97cafb5ab56db.tar.gz tcl-344b1b937d1a871631547e9829f97cafb5ab56db.tar.bz2 |
* doc/clock.n:
* doc/registry.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.
Synced other changes from HEAD.
FossilOrigin-Name: 8cd37342ff9f8baeca8bfe5e4ce71dc2c8c929c2
Diffstat (limited to 'doc/upvar.n')
-rw-r--r-- | doc/upvar.n | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/doc/upvar.n b/doc/upvar.n index b73d6a4..795629f 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.5.18.1 2004/10/27 14:43:15 dkf Exp $ +'\" RCS: @(#) $Id: upvar.n,v 1.5.18.2 2004/11/12 09:02:30 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 add2 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 |