Introduction
Now that we have a firm grasp on the string type, let's look at the Tcl command list
. As you might have discerned from the command name, this command is used to create and manage lists of information. While the various string handling commands allow for the creation of a string containing anything from a single character to larger text files, the list allows you to create, manipulate, and utilize a list of arguments in the same manner as a shopping list. In Tcl, each of the separate items in a list are referred to as elements.
In the following sections, we will examine not only the creation of a list, but also the many commands provided by Tcl to allow you to fully utilize the list and its elements. As a pre-requisite for the recipes in this chapter, launch the Tcl shell appropriately for your operating system. You can access Tcl from the command line to execute the commands.