spool-lang / Spool-Legacy-Repo

Legacy repo for the Spool programming language.
3 stars 0 forks source link

Main #13

Open RedstoneParadox opened 5 years ago

RedstoneParadox commented 5 years ago

Overview

Main is a special function (#5) that is the entry point of the program which is declared outside of any class. Inside, it is the same as any other function. It is declared by the main keyword like so:

main {

}

Parameters can also be specified for main, but these must be of the string type or any type that can be converted from a string.


main(arg1: String, arg2 : Int) {

}

Note that main cannot have generic parameters (#9).

RedstoneParadox commented 5 years ago

As of commit fc3fa3de7ec490243912a2a3f2fa0eea05f87e80, the main function is now recognized, however it is not yet able to have parameters.