Logo

Programming-Idioms

Write a loop that has no end clause.
Implementation
Prolog

Implementation edit is for fixing errors and enhancing with metadata. Please do not replace the code below with a different implementation.

Instead of changing the code of the snippet, consider creating another Prolog implementation.

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating material.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
for(;;){
	// Do something
}
for {
	// Do something
}
while (1) {
   do_stuff();
}
loop {
	// Do something
}
while (true) {
    // do something
}
#define forever while(1)
forever {
	// Do something
}
for(;;){
	// Do something
}
while(1){
	// Do something
}
while (true) { }
while True:
    pass
while (true) {
  // do something
}
While True do { nothing };
loop do
  # endless joy
end
import Control.Monad
forever (getLine >>= putStrLn)
defmodule Looping do
	def infinite do
		# Write code here	
		infinite
	end
end
while(true) {
	// Do something	
}
loop() ->
	do:something(),
	loop().
while true do 
	-- Do something
end
loop
   null;
end loop;
while (true)
{
    // Do something
}
for (;;) {
	/// Do something
}
while (true) {
	// Do something
}
while (true) {
	// to infinity
}
while(true){
  println(3)
}
for (;;) {}
(loop []
  ;; do something
  (recur))
say "" while True;
(loop)
repeat, write("hello\n").
do
end do
for(;;) {
	console.log('Oops')
}
while (true) { }
let x = x in x
IDENTIFICATION DIVISION.
PROGRAM-ID. no end loop.
PROCEDURE DIVISION.
PERFORM UNTIL 1 < 0
   DISPLAY "Something"
END-PERFORM
STOP RUN.
Do
    ' Do something
Loop
repeat until false;
loop:
	goto loop;
import Control.Monad
forever $ pure ()
for (;;);
for (;;) {

}
(let forever ()
  (forever))
(defun infinite-loop (x)
  (apply x (infinite-loop x)))
[] repeat.
?- repeat, false.

% repeat/0 is built-in, but could be defined like this:
repeat.
repeat :- repeat.
while (true) { }