Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Lisp
(do () (nil)
  (write-line "Control-C to quit this infinite loop")
  (sleep 1))

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 its non-Lispy syntax.
(defun infinite-loop (x)
  (apply x (infinite-loop x)))

Not exactly the same as the original since that was in scheme and this is Common Lisp but it infinitely loops until the control stack is exhausted.
(loop)
loop
   null;
end loop;

null; means "do nothing"

New implementation...
< >
programming-idioms.org