Hacker News new | past | comments | ask | show | jobs | submit
No, I mean do. It's basically just a C style for loop except with a return value. Nothing special.
yes the syntax for 'do is simple, like that of lisp. however 'do allows you to make far more complex iteration constructs than 'loop. 'loop is just a DSL to make some of these constructs more concise. read up on it
LOOP has the DO functionality included.

Example:

    CL-USER 18 > (do ((a 1 (+ a 1))
                      (b 10 (* b 1.5))
                      (c nil))

                     ((> a 5) (list a b (reverse c)))

                   (push (* a b) c))

    (6 75.9375 (10 30.0 67.5 135.0 253.125))

    CL-USER 19 > (loop for a = 1 then (+ a 1)
                       and b = 10 then (* b 1.5)
                       and c = NIL then c

                       when (> a 5) do (return (list a b (reverse c)))

                       do (push (* a b) c))

    (6 75.9375 (10 30.0 67.5 135.0 253.125))
You can also express LOOP constructs in terms of DO. However if you were to construct a more exotic iterator that is not so straight forward in LOOP (beware of edge cases), I think it is more reasonable to pick DO. I think also that your example illustrates this.
loading story #41876971