DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

eval(n)




______________________________________________________________________________


NAME

       eval - Evaluate a Tcl script


SYNOPSIS

       eval arg ?arg ...?
_________________________________________________________________


DESCRIPTION

       Eval  takes one or more arguments, which together comprise a Tcl script
       containing one or more commands.  Eval concatenates all  its  arguments
       in  the  same  fashion  as  the concat command, passes the concatenated
       string to the Tcl interpreter recursively, and returns  the  result  of
       that  evaluation  (or  any  error generated by it).  Note that the list
       command quotes sequences of words in such a way that they are not  fur-
       ther expanded by the eval command.


EXAMPLE

       This  procedure acts in a way that is analogous to the lappend command,
       except it inserts the argument values at the start of the list  in  the
       variable:
              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 [eval [list linsert $var 0] $args]
              }


KEYWORDS

       concatenate, evaluate, script


SEE ALSO

       catch(n), concat(n), error(n), list(n), subst(n), tclvars(n)

Tcl                                                                    eval(n)

Man(1) output converted with man2html