Category:Tcl: Difference between revisions

→‎Key Commands: Described another important command
m (Change to internal link)
(→‎Key Commands: Described another important command)
Line 84:
:Generate an error exception. The additional optional arguments allow finer control over the exception.
'''eval''' ''arg''...
:Concatenate the arguments and evaluate the resulting string as a script. Note that from Tcl 8.5 onwards, this should only be used very rarely; the expansion syntax covers the vast majority of previous uses for <tt>eval</tt>..
'''list''' ''arg''...
:Create a list out of the arguments and return it. The resulting list is also guaranteed to be a well-formed script that will evaluate the sequence of arguments as a command and arguments without further substitution, making the '''list''' command useful for predictable code synthesis.
'''proc''' ''name formalArgs body''
:Define a new command called ''name'' that pushes a new stack frame, accepts arguments and binds them to the list of local variable names given in ''formalArgs'' and then evaluates ''body''.
Anonymous user