Start from a main routine: Difference between revisions

Added Kotlin
No edit summary
(Added Kotlin)
Line 142:
 
If you want the script to exit even when it hits an error, you can use an [http://www.jsoftware.com/help/dictionary/dx009.htm#26 immex phrase], which will be the first thing executed by the event loop, before it prompts.
 
=={{header|Kotlin}}==
The version of Kotlin which targets the JVM always starts from the main(args: Array<String>) function unless it is running in REPL mode when it simply executes lines of executable code in the order presented. The REPL is started by typing, kotlinc, without any parameters at the command prompt. For example:
 
{{out}}
<pre>
Welcome to Kotlin version 1.1.1 (JRE 1.8.0_121-b13)
Type :help for help, :quit for quit
>>> println("Look no main!")
Look no main!
>>> :quit
</pre>
 
=={{header|Logtalk}}==
9,488

edits