Skip to content

Instantly share code, notes, and snippets.

@Burgestrand
Last active May 12, 2020 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Burgestrand/ba9c2d93a23bd858181ec5b77cd948a6 to your computer and use it in GitHub Desktop.
Save Burgestrand/ba9c2d93a23bd858181ec5b77cd948a6 to your computer and use it in GitHub Desktop.
public struct Environment {
init() {
print("Current.init")
}
public var name = "World"
}
public var Current: Environment! = Environment()
import Environment
print("Hello")
print(Current.name)
default: compile
./Main
compile: Main
Main: Environment
swiftc Main.swift -I . -L . -lEnvironment
Environment: Environment.swift libEnvironment.dylib
swiftc -emit-library -emit-module -parse-as-library Environment.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment