javascript style closures in swift
//swift closure implementation relative to javascript
//makes a function that adds some number to another number
func makeaddfunc(amount:Int) -> (Int) -> Int {
return {(num:Int) -> Int in num + amount}
}
let adder = makeaddfunc(4)
print(adder(4))
//8