
1.1.2 Differences between LOOP and DO
;;; These loops read from one stream and write to another.
;;; Typical code that uses the DO macro requires duplication
;;; that is not necessary in the Loop Facility code.
(loop for char = (read-char instream nil) ; Use Loop Facility
while char ; constructs.
do (write-char char outstream))
(do ((char (read-char instream nil) ; Use the DO macro.
(read-char instream nil)))
((null char) nil)
(write-char char outstream))

Generated with Harlequin WebMaker