Start from a main routine: Difference between revisions

→‎{{header|PicoLisp}}: Add Processing section
m (Add omit from Rust)
(→‎{{header|PicoLisp}}: Add Processing section)
Line 300:
=={{header|PicoLisp}}==
PicoLisp automatically starts a REPL (read-eval-print loop), which is a kind of event loop. If that is not desired, call (wait), or pass -wait on the command line. Per convention, the GUI event loop is started by calling (go), or by passing -go on the command line.
 
=={{header|Processing}}==
By default, Processing executes the given list of commands with no required main function/method. This is called "immediate mode."
 
<lang Processing>println("hello world");
line(0, 0, width, height);</lang>
 
Most of the Processing API can be used in immediate mode--however, it has no event loop, so it cannot support animation, interaction (such as keyboard or mouse) or time-based media such as audio or video. Further, this mode cannot define new functions/methods, or classes. For example, this is invalid:
 
<lang Processing>void hello() {
println("hello world");
}
hello();</lang>
 
In order to define functions or use these language features, setup() and/or draw() must be defined in a Processing sketch. These serve as the equivalent of a main() entrypoint. For example, this is a valid sketch:
 
<lang Processing>void setup() {
hello();
}
void hello() {
println("hello world");
}</lang>
 
setup() -- or draw() if there is no setup() -- acts as an entrypoint to the sketch, with draw() also serving as an event loop that by default is called at 60fps.
 
=={{header|PureBasic}}==