Logo

Programming-Idioms

History of Idiom 50 > diff from v71 to v72

Edit summary for version 72 by mtreis86:
New Lisp implementation by user [mtreis86]

Version 71

2021-07-14, 03:18:26

Version 72

2021-08-15, 23:54:06

Idiom #50 Make an infinite loop

Write a loop which has no end clause.

Ouroboros eating its own tail

Idiom #50 Make an infinite loop

Write a loop which has no end clause.

Ouroboros eating its own tail
Code
(defun infinite-loop (x)
  (apply x (infinite-loop x)))
Comments bubble
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.
Origin
https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures/7b-metacircular-evaluator-part-2/