At Peter Zeibel's Practical General Lisp, he gives this example:
(do ((nums nil) (i 1 (1+ i))) ((> i 10) (nreverse nums)) (push i nums))
I see how this works, using nums inside the loop, but not providing it with a step form. Why would you put nums in a variable definition and not this:
(let (nums) (do ((i 1 (+ i 1))) ((> i 10) (nreverse nums)) (push i nums)))
I am sure that there is a good reason, but I still do not understand.
syntax let lisp do-loops
Jasonfruit
source share