![[LISPWORKS]](../Graphics/LWSmall.gif)
![[Previous]](../Graphics/Prev.gif)
![[Up]](../Graphics/Up.gif)
![[Next]](../Graphics/Next.gif)
6.1.2.1.2.1 Examples of for-as-in-list subclause
;; Print every item in a list.
(loop for item in '(1 2 3) do (print item))
>> 1
>> 2
>> 3
=> NIL
;; Print every other item in a list.
(loop for item in '(1 2 3 4 5) by #'cddr
do (print item))
>> 1
>> 3
>> 5
=> NIL
;; Destructure a list, and sum the x values using fixnum arithmetic.
(loop for (item . x) of-type (t . fixnum) in '((A . 1) (B . 2) (C . 3))
unless (eq item 'B) sum x)
=> 4
The following X3J13 cleanup issue, not part of the specification, applies to this section:
![[Starting Points]](../Graphics/StartPts.gif)
![[Contents]](../Graphics/Contents.gif)
![[Index]](../Graphics/Index.gif)
![[Symbols]](../Graphics/Symbols.gif)
![[Glossary]](../Graphics/Glossary.gif)
![[Issues]](../Graphics/Issues.gif)
Copyright 1996-2005, LispWorks Ltd. All rights reserved.