Re: Break Statements similar to C or C++



On May 30, 10:06 pm, "gokul.m...@xxxxxxxxx" <gokul.m...@xxxxxxxxx>
wrote:
Can we use the return macro for exiting from the while loops also??

There's no built-in while loop in cl, but you can build one with
macro.

Here's an example with the loop macro

CL > (loop for i from 1
while (< i 10)
if (= i 5) do (return)
else do (princ i))

1234
NIL

.



Relevant Pages

  • Re: Style question: LOOP and multiple values
    ... With a 'smarter' LOOP macro ... > the problem would be reduced to do something clever with ... Just have LOOP look into the form-to-be-destructured. ...
    (comp.lang.lisp)
  • Re: Loop Alternatives
    ... specification is pretty vague on the specifics of "loop" and as such, ... Ken Pittman writes: ... the syntax as simple and important to be uncluttered by the extra parens. ... Has anyone implemented a loop macro using this syntax? ...
    (comp.lang.lisp)
  • Loop Alternatives
    ... specification is pretty vague on the specifics of "loop" and as such, ... Ken Pittman writes: ... the syntax as simple and important to be uncluttered by the extra parens. ... Has anyone implemented a loop macro using this syntax? ...
    (comp.lang.lisp)
  • Re: Loop Alternatives
    ... specification is pretty vague on the specifics of "loop" and as such, ... the syntax as simple and important to be uncluttered by the extra parens. ... Has anyone implemented a loop macro using this syntax? ...
    (comp.lang.lisp)
  • Re: SETF and variable issues in Self Similar program.
    ... | the LOOP macro, is APPEND as a LOOP command as ... | inefficient as APPEND in its normal sense outside of the LOOP macro? ... Probably not *quite* as inefficient, ...
    (comp.lang.lisp)