Commit | Line | Data |
---|---|---|
2539e6af KR |
1 | //****************************************************************************** |
2 | // MAL - main | |
3 | //****************************************************************************** | |
4 | ||
5 | // Swift requires that main() be invoked from a file named "main.swift". See the | |
6 | // paragraph "Application Entry Points and “main.swift” on | |
7 | // https://developer.apple.com/swift/blog/?id=7: | |
8 | // | |
9 | // You’ll notice that earlier we said top-level code isn’t allowed in most | |
10 | // of your app’s source files. The exception is a special file named | |
11 | // “main.swift”, which behaves much like a playground file, but is built | |
12 | // with your app’s source code. The “main.swift” file can contain top-level | |
13 | // code, and the order-dependent rules apply as well. In effect, the first | |
14 | // line of code to run in “main.swift” is implicitly defined as the main | |
15 | // entrypoint for the program. This allows the minimal Swift program to be | |
16 | // a single line — as long as that line is in “main.swift”. | |
17 | ||
18 | main() |