ToC | DocOverview | CGDoc | RelNotes | Index | PermutedIndex
| Allegro CL

| 6.1 The LOOP Facility 6.1.2 Variable Initialization and Stepping Clauses 6.1.2.1 Iteration Control 6.1.2.1.1 The for-as-arithmetic subclause ### 6.1.2.1.1.1 Examples of for-as-arithmetic subclause
    ;; Print some numbers.
     (loop for i from 1 to 3
           do (print i))
    1
    2
    3
      NIL

    ;; Print every third number.
     (loop for i from 10 downto 1 by 3
           do (print i))
    10
    7
    4
    1
      NIL

    ;; Step incrementally from the default starting value.
     (loop for i below 3
           do (print i))
    0
    1
    2
      NIL

© Franz Inc. All Rights Reserved - File last updated 2022-07-25