This chapter describes explicit calls to the interpreter with the
eval command. An extra round of substitutions is performed that results in some useful effects. The chapter describes the quoting problems with
eval and the ways to avoid them. The
uplevel command evaluates commands in a different scope. The
subst command does substitutions but no command invocation.
Dynamic evaluation makes Tcl flexible and powerful, but it can be tricky to use properly. The basic idea is that you create a string and then use the
eval command to interpret that string as a command or a series of commands. Creating program code on the fly is easy with an interpreted language like Tcl, and very hard, if not impossible, with a statically ...