This page resulted from a discussion on [comp.lang.tcl], starting 2015-02-12 titled [https://groups.google.com/forum/#!topic/comp.lang.tcl/dzyJw3Q0dGs%|%"Definition of 'Tcl Script'"]. '''NOTE''': if anyone has a more resilient link for usenet discussion than Google, please substitute it here. Rule #1 of the [Dodekalogue] states that a script consists of one or more commands. This is a bit counterintuitive, since the empty string is obviously a script: ====== % eval {} ====== So this is "at least one command", yet no commands are executed. What's going on? While it doesn't have much effect in practice, the way the Tcl interpreter is structured means that the empty script is made up of exactly one command, which has no words. To justify this requires digging into the Tcl parser, which is kinda fun anyway, so let's have a look. * The [http://core.tcl.tk/tcl/artifact/84235b4805a3810b?ln=208-248%|%definition of Tcl_ParseCommand] begins here. * Its [http://core.tcl.tk/tcl/artifact/6f1e1e3358c10b4f?ln=5077-5095%|%call site in Tcl_EvalEx]. * Relevant parts of the [http://core.tcl.tk/tcl/artifact/947fcc72f55d1aca?ln=2036-2050%|%Tcl_Parse structure declaration] are here. In short: `Tcl_EvalEx` repeatedly calls `Tcl_ParseCommand`, which fills in a `Tcl_Parse` structure with information about the next command in the script. The relevant parts of this structure here are `commentStart`, `commentSize`, `commandStart`, `commandSize` and `numWords`. Thus, we can infer that each call to `Tcl_ParseCommand` consumes a leading comment and a single command from the input. In the case of the empty script (or a script containing only comments and whitespace), `commandSize` and `numWords` are both 0, so the condition `if (parsePtr->numWords > 0)` is false and `Tcl_EvalEx` skips evaluation, [http://core.tcl.tk/tcl/artifact/6f1e1e3358c10b4f?ln=5294-5308%|%advances to the end of the script] and finishes the loop. So, it seems the empty script contains one command, which is empty. Commands (like the empty command) which contain no words are parsed, but not evaluated. How much this knowledge is worth? I don't know. You can observe some of this behaviour at the script level with [tclparser]. Short of reaching into the parser, the empty command seems to be unobservable: * [info cmdcount] doesn't increase * `enterstep` [trace]s don't fire * [interp limit]s are not bumped