Logo

Programming-Idioms

History of Idiom 50 > diff from v94 to v95

Edit summary for version 95 by sitting_bull:
New Lisp implementation by user [sitting_bull]

Version 94

2024-11-18, 20:37:44

Version 95

2025-01-06, 11:50:40

Idiom #50 Make an infinite loop

Write a loop that has no end clause.

Ouroboros eating its own tail

Idiom #50 Make an infinite loop

Write a loop that has no end clause.

Ouroboros eating its own tail
Extra Keywords
unbounded,unlimited,never,ouroboros,uroboros
Extra Keywords
unbounded,unlimited,never,ouroboros,uroboros
Code
(do () (nil)
  (write-line "Control-C to quit this infinite loop")
  (sleep 1))
Comments bubble
Kill the Lisp process to exit.
DO is the most general kind of loop, supporting local variables and complex iteration logic.
A common alternative is "(LOOP)", but you'll have to learn it's non-Lispy syntax.
Doc URL
https://www.lispworks.com/documentation/HyperSpec/Body/m_do_do.htm