Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The format function with its many control sequences is practically a programming language in its own right. (In fact, many Lispers would call it a domain-specific language, a concept we will revisit in Chapter 17.) And, like most programming languages, format can loop through data. It does this using the ˜{ and ˜} control sequences.
To achieve this looping, pass the format function a control string containing ˜{ and ˜}, and a list to iterate through. The part of the control string between the ˜{ and ˜} sequences is treated almost like the body of a loop. It will be executed a number of times, depending on the length of the list that follows it. The format function will iterate through this list, applying each of its items to the specified section of the control string.