diff options
Diffstat (limited to 'doc/interp.n')
-rw-r--r-- | doc/interp.n | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/doc/interp.n b/doc/interp.n index e219d15..8516941 100644 --- a/doc/interp.n +++ b/doc/interp.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: interp.n,v 1.18 2004/10/27 12:53:22 dkf Exp $ +'\" RCS: @(#) $Id: interp.n,v 1.19 2004/10/27 14:24:37 dkf Exp $ '\" .so man.macros .TH interp n 7.6 Tcl "Tcl Built-In Commands" @@ -717,30 +717,30 @@ by Nathaniel Borenstein and Marshall Rose. .SH EXAMPLES Creating and using an alias for a command in the current interpreter: .CS -\fBinterp\fR alias {} getIndex {} lsearch {alpha beta gamma delta} +\fBinterp alias\fR {} getIndex {} lsearch {alpha beta gamma delta} set idx [getIndex delta] .CE .PP Executing an arbitrary command in a safe interpreter where every invokation of \fBlappend\fR is logged: .CS -set i [\fBinterp\fR create -safe] -\fBinterp\fR hide $i lappend -\fBinterp\fR alias $i lappend {} loggedLappend $i +set i [\fBinterp create\fR -safe] +\fBinterp hide\fR $i lappend +\fBinterp alias\fR $i lappend {} loggedLappend $i proc loggedLappend {i args} { puts "logged invokation of lappend $args" - \fBinterp\fR invokehidden $i lappend {expand}$args + \fBinterp invokehidden\fR $i lappend {expand}$args } -\fBinterp\fR eval $i $someUntrustedScript +\fBinterp eval\fR $i $someUntrustedScript .CE .PP .VS 8.5 Setting a resource limit on an interpreter so that an infinite loop terminates. .CS -set i [\fBinterp\fR create] -\fBinterp\fR limit $i command -value 1000 -\fBinterp\fR eval $i { +set i [\fBinterp create\fR] +\fBinterp limit\fR $i command -value 1000 +\fBinterp eval\fR $i { set x 0 while {1} { puts "Counting up... [incr x]" |