4 ms·
I assume you're thinking about Schemes `(let loop (...) ...)`, but that doesn't exist in Common Lisp. CL:LOOP is a looping macro with its own small DSL. (l
by juki 9y ago
I assume you're thinking about Schemes `(let loop (...) ...)`, but that doesn't exist in Common Lisp. CL:LOOP is a looping macro with its own small DSL.
(loop :for i :below 5
:when (evenp i) :collect i)
;=> (0 2 4)
- lispm 9y agoThat's a step up from loops with 'goto': (prog ((result '()) (i 0)) loop (when (>= i 5) (return (reverse result))) (when (evenp i) (push i result)) (incf i) (go loop))