summaryrefslogtreecommitdiffstats
path: root/doc/eval.n
diff options
context:
space:
mode:
Diffstat (limited to 'doc/eval.n')
-rw-r--r--doc/eval.n15
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/eval.n b/doc/eval.n
index 76c37f2..8ae0457 100644
--- a/doc/eval.n
+++ b/doc/eval.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: eval.n,v 1.4 2002/08/28 14:46:50 dkf Exp $
+'\" RCS: @(#) $Id: eval.n,v 1.4.2.1 2004/10/27 09:35:38 dkf Exp $
'\"
.so man.macros
.TH eval n "" Tcl "Tcl Built-In Commands"
@@ -27,6 +27,19 @@ Tcl interpreter recursively, and returns the result of that
evaluation (or any error generated by it).
Note that the \fBlist\fR command quotes sequences of words in such a
way that they are not further expanded by the \fBeval\fR command.
+.SH EXAMPLE
+This procedure acts in a way that is analogous to the \fBlappend\fR
+command, except it inserts the argument values at the start of the
+list in the variable:
+.CS
+proc lprepend {varName args} {
+ upvar 1 $varName var
+ # Ensure that the variable exists and contains a list
+ lappend var
+ # Now we insert all the arguments in one go
+ set var [\fBeval\fR [list linsert $var 0] $args]
+}
+.CE
.SH KEYWORDS
concatenate, evaluate, script