- Iteration for each element in a list:
> (loop for

__i in '(1 2 3)__do (print i)) 1 2 3 - Iteration for each cdr of a list:
> (loop for

__i on '(1 2 3)__do (print i)) (1 2 3) (2 3) (3) - Iteration for each element in a vector:
> (loop for

__i across #(1 2 3)__do (print i)) 1 2 3 - Iteration for each key of a hashtable:
> (setf h (make-hash-table)) > (setf (gethash 'a h) 1) > (setf (gethash 'b h) 2) > (loop for

__k being the hash-key of h__do (print k)) b a - Iteration for each value of a hashtable:
> (loop for

__v being the hash-value of h__do (print v)) 2 1 - Iteration for each key-value pair of a hashtable:
> (loop for

__k being the hash-key using (hash-value v)__of h do (format t "~a ~a~%" k v)) b 2 a 1 - i=1, while i <= 3:
> (loop for

__i from 1 to 3__do (print i)) 1 2 3 - i=1, while i <= 3: (different step)
> (loop for

__i from 1.0 to 3.0 by 0.5__do (print i)) 1.0 1.5 2.0 2.5 3.0 - i=3, while i >= 1:
> (loop for

__i from 3 downto 1__do (print i)) 3 2 1 - i=3, while i >= 1: (different step)
> (loop for

__i from 3.0 downto 1.0 by 0.5__do (print i)) 3.0 2.5 2.0 1.5 1.0 - i=1, while i < 3:
> (loop for

__i from 1 below 3__do (print i)) 1 2 - i=3, while i > 1:
> (loop for

__i from 3 above 1__do (print i)) 3 2 - Adding initialization:
> (loop

__with a = '(1 2 3)__for i in a do (print i)) 1 2 3 - Adding subordinate variables:
> (loop for i from 1 to 3

__for x = (* i i)__do (print x)) 1 4 9 - Adding conditional branch for each element:
> (loop for i from 1 to 3

__when (oddp i)__do (print i)) 1 3 - Adding a termination condition (while):
> (loop for i from 1 to 3 while (< i 2) do (print i)) 1

- Adding a termination condition (until):
> (loop for i from 1 to 3 until (< 2 i) do (print i)) 1 2

- Collecting results as an element of a list:
> (loop for i from 1 to 3

__collect (* i i)__) (1 4 9) - Concatenating results as a list:
> (loop for i from 1 to 3

__append (list i i)__) (1 1 2 2 3 3) - Counting:
> (loop for i from 1 to 3

__count (oddp i)__) 2 - Summation:
> (loop for i from 1 to 3

__sum (* i i)__) 14 - Taking the maximum value:
> (loop for i from 1 to 3

__maximize (mod i 3)__) 2 - Taking the minimum value:
> (loop for i from 1 to 3

__minimize (mod i 3)__) 0

Yusuke Shinyama