Modules
Introduction to modules.
module MyMod.Utilsmodule Math.Constants
public func Pi() -> Float = 3.14159
public func E() -> Float = 2.71828// In another file
import Math.Constants.Pi
class Circle {
let circumference: Float;
public final func Radius() -> Float {
return this.circumference / (2.0 * Pi());
}
}Last updated
Was this helpful?