summaryrefslogtreecommitdiffstats
path: root/doc/eval.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-10-27 09:35:37 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-10-27 09:35:37 (GMT)
commitc782c91eb43cbb2f3c6d387ce7c124c770bb7191 (patch)
tree2f3f979845a50074bb8e2a0687cd98cb14ae6c26 /doc/eval.n
parent59ddf1865eb7d0cbb45c9a62fa80360d16b34883 (diff)
downloadtcl-c782c91eb43cbb2f3c6d387ce7c124c770bb7191.zip
tcl-c782c91eb43cbb2f3c6d387ce7c124c770bb7191.tar.gz
tcl-c782c91eb43cbb2f3c6d387ce7c124c770bb7191.tar.bz2
Backport many doc fixes
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