I can\'t find it in the language reference. The standard template doesn\'t give a clue:
import Foundation println(\"Calculating\") // How to set and exit c
Found it! You should just call:
exit(yourExitCode)