summaryrefslogtreecommitdiffstats
path: root/doc/interp.n
diff options
context:
space:
mode:
Diffstat (limited to 'doc/interp.n')
-rw-r--r--doc/interp.n26
1 files changed, 13 insertions, 13 deletions
diff --git a/doc/interp.n b/doc/interp.n
index 17eae53..e219d15 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.17 2004/09/21 16:20:02 dkf Exp $
+'\" RCS: @(#) $Id: interp.n,v 1.18 2004/10/27 12:53:22 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
-interp alias {} getIndex {} lsearch {alpha beta gamma delta}
+\fBinterp\fR alias {} getIndex {} lsearch {alpha beta gamma delta}
set idx [getIndex delta]
.CE
-
-.VS 8.5
+.PP
Executing an arbitrary command in a safe interpreter where every
invokation of \fBlappend\fR is logged:
.CS
-set i [interp create -safe]
-$i hide lappend
-$i alias lappend loggedLappend $i
+set i [\fBinterp\fR create -safe]
+\fBinterp\fR hide $i lappend
+\fBinterp\fR alias $i lappend {} loggedLappend $i
proc loggedLappend {i args} {
puts "logged invokation of lappend $args"
- $i invokehidden lappend {expand}$args
+ \fBinterp\fR invokehidden $i lappend {expand}$args
}
-$i eval $someUntrustedScript
+\fBinterp\fR eval $i $someUntrustedScript
.CE
-
+.PP
+.VS 8.5
Setting a resource limit on an interpreter so that an infinite loop
terminates.
.CS
-set i [interp create]
-$i limit command -value 1000
-$i eval {
+set i [\fBinterp\fR create]
+\fBinterp\fR limit $i command -value 1000
+\fBinterp\fR eval $i {
set x 0
while {1} {
puts "Counting up... [incr x]"