//: Variable Capture at last!!! typealias IntMaker = (Void)->Int func makeCounter()->IntMaker{ var n = 0 func adder()->Int{ n + n + 1 return n } return adder } let counter1 = makeCounter() let counter2 = makeCounter() counter1()
typealias BinaryFunc = (Int, Int) -> Int var z = 42.42 func g(x:Int)->Double{ return Double(x) / z }