Logo

Programming-Idioms

History of Idiom 50 > diff from v80 to v81

Edit summary for version 81 by programming-idioms.org:
[Prolog] Emphasize in comments

Version 80

2022-02-23, 21:05:34

Version 81

2022-02-24, 00:43:09

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
loop :- loop.

?- loop.
Code
loop :- loop.

?- loop.
Comments bubble
loop succeeds if loop succeeds, so when we ask the top level if loop succeeds, it proceeds to ask if loop succeeds.
Comments bubble
loop succeeds if loop succeeds, so when we ask the top level if loop succeeds, it proceeds to ask if loop succeeds.