Version 5 of Command variety

Updated 2009-03-18 11:14:37 by LV

Tcl has a variety of types of commands. The following are all types of commands which are indistinguishable to their caller (that bit is important):

The interesting thing about this is that each of these command types can fully simulate the others. CMcC

Some of them are ensemble commands, we might say. Namespace ensembles, TclOO objects, interps in a sense contain other commands, or simulate their containment.

I look forward to the day when a builtin is being simulated by a coroutine, or a builtin is provided by a coroutine.

One could possibly stretch the analogy to include the reflected channel mechanism, since it is defined over a user-supplied container of commands.

The distinction between different kinds of command containers is probably the type of state they support, and the degree and kind of encapsulation they provide for state.