Loops/Infinite: Difference between revisions
< Loops
Content added Content deleted
Line 43: | Line 43: | ||
puts "SPAM" |
puts "SPAM" |
||
end</pre> |
end</pre> |
||
=={{header|UnixPipes}}== |
|||
yes SPAM |
Revision as of 04:47, 11 April 2008
Perform the same series of actions indefinitely.
Specifically print out "SPAM" followed by a newline in an infinite loop.
Ada
loop Put_Line("SPAM"); end loop;
C
while(1) puts("SPAM");
Common Lisp
(loop (write-line "SPAM"))
Groovy
while (true) { println 'SPAM' }
Haskell
forever (putStrLn "SPAM")
Java
while(true) { System.out.println("SPAM"); }
Logo
forever [print "SPAM]
Perl
while(1){print"SPAM\n"}
Prolog
repeat, write('SPAM'), nl, fail.
Python
while 1: print "SPAM"
Ruby
while true do puts "SPAM" end
UnixPipes
yes SPAM