Start from a main routine: Difference between revisions

Added Wren
m (Fix Perl 6 -> Raku in comments)
(Added Wren)
Line 542:
{{out|input=foo /bar baz "visual basic"}}
<pre>main; args:foo, /bar, baz, visual basic</pre>
 
=={{header|Wren}}==
Wren doesn't have (or need) a ''main'' function. Scripts just run from top to bottom (after a bytecode compilation stage).
 
However, it's easy enough to create a ''main'' function and call that to start execution of the script.
<lang ecmascript>var main = Fn.new {
System.print("Hello from the main function.")
}
 
main.call()</lang>
 
{{out}}
<pre>
Hello from the main function.
</pre>
 
=={{header|zkl}}==
9,488

edits