from the command line, updated from
xcrun swift test.swift
which I used to do.
I was excited to find that it is possible to use code in more than one Swift file, like this:
swiftc file1.swift main.swift -o prog
Reading the man page for
swiftcI find these ideas:
swiftc -emit-library card.swift
which runs and gives
libcard.dylibbut I have no idea how to import it from Swift.
There is also
-emit-module, which gives
card.swiftmodulebut I have no idea how to use them.
Maybe I should look inside Xcode and try to figure out how it accomplishes what it does?