Logo

Programming-Idioms

History of Idiom 50 > diff from v36 to v37

Edit summary for version 37 by :
New Scala implementation by user [meshelton]

Version 36

2016-02-16, 21:31:58

Version 37

2016-02-18, 16:57:59

Idiom #50 Make an infinite loop

Write a loop which has no end clause.

Idiom #50 Make an infinite loop

Write a loop which has no end clause.

Code
while (true) {
	// Do something
}
Code
while (true) {
	// Do something
}
Comments bubble
You may remove the curly braces if the block is only 1 instruction.

The compiler might warn you that the loop expression is never false.
Comments bubble
You may remove the curly braces if the block is only 1 instruction.

The compiler might warn you that the loop expression is never false.
Code
for (;;) {
	/// Do something
}
Code
for (;;) {
	/// Do something
}
Comments bubble
You may remove the curly braces if the block is only 1 instruction.
Comments bubble
You may remove the curly braces if the block is only 1 instruction.
Code
loop
   null;
end loop;
Code
loop
   null;
end loop;
Comments bubble
'null;' means do nothing
Comments bubble
'null;' means do nothing