Start from a main routine: Difference between revisions

(Added Algol 68)
Line 215:
=={{header|Mathematica}}==
Mathematica automatically starts a REPL (read-eval-print loop), which is a kind of event loop. If that is not desired, pass -run on the command line. Note that if Mathematica is called via MathLink from within an external program, then the main loop has to be defined, which will usually differ from the standard one.
 
=={{header|Nim}}==
You can use the variable isMainModule to create a starting point for code execution in Nim.
 
<pre>
proc boogie*(moves: int) =
for i in 1..moves:
echo $i
when isMainModule:
boogie(5)
</pre>
 
In this example, the procedure call boogie(5) will only execute if the module containing it is compiled and run directly. If the module is merely imported by another module, the code will not execute.
 
=={{header|Oforth}}==
Anonymous user