RosettaCodeData/Task/Loops-N-plus-one-half/Common-Lisp/loops-n-plus-one-half-4.lisp
2023-07-01 13:44:08 -04:00

6 lines
341 B
Common Lisp

(do ((i 1 (incf i))) ; Initialize to 1 and increment on every loop
((> i 10)) ; Break condition
(princ i) ; Print the iteration number
(when (= i 10) (go end)) ; Use the implicit tagbody and go to end tag when reach the last iteration
(princ ", ") ; Printing the comma is jumped by the go statement
end) ; The tag