Control Flow - Loops

Loops

A loop is a sequence of statements which is specified once but which may be carried out several times in succession. The code "inside" the loop (the body of the loop, shown below as xxx) is obeyed a specified number of times, or once for each of a collection of items, or until some condition is met, or indefinitely.

In functional programming languages, such as Haskell and Scheme, loops can be expressed by using recursion or fixed point iteration rather than explicit looping constructs. Tail recursion is a special case of recursion which can be easily transformed to iteration.

Read more about this topic:  Control Flow

Famous quotes containing the word loops:

    In the labyrinth of a difficult text, we find unmarked forks in the path, detours, blind alleys, loops that deliver us back to our point of entry, and finally the monster who whispers an unintelligible truth in our ears.
    Mason Cooley (b. 1927)

    An accurate charting of the American woman’s progress through history might look more like a corkscrew tilted slightly to one side, its loops inching closer to the line of freedom with the passage of time—but like a mathematical curve approaching infinity, never touching its goal. . . . Each time, the spiral turns her back just short of the finish line.
    Susan Faludi (20th century)