(loop for a from 5 to 10 and b = a do (format t "~d ~d~%" ab))
Above the code can be seen conceptually close to the PSETF. Values ββare updated in 'parallel'. The reason is that AND.
Replace AND with FOR:
(loop for a from 5 to 10 for b = a do (format t "~d ~d~%" ab))
Above, it will update variables conceptually close to the usual SETF, sequentially.
CL-USER 20 > (loop for a from 5 to 10 for b = a do (format t "~d ~d~%" ab)) 5 5 6 6 7 7 8 8 9 9 10 10
For an explanation, see Common Lisp HyperSpec 6.1.2.1 Iterative Control :
If multiple iteration clauses are used to control iteration, the default initialization and stepping variable. And the design can be used to connect two or more iterative articles when sequential linking and stepping is not necessary. Iterative behavior related to and similar to macro behavior with respect to do *.
source share