Skip to content

Instantly share code, notes, and snippets.

@nuclearace
Last active August 29, 2015 14:16
Show Gist options
  • Save nuclearace/4da3f9abce5c2a45779c to your computer and use it in GitHub Desktop.
Save nuclearace/4da3f9abce5c2a45779c to your computer and use it in GitHub Desktop.
typealias MyFunction = (Int...) -> Int
func makeFunction(b:Int) -> MyFunction {
return {n in
let d = n.reduce(b) {$0 - $1}
return d
}
}
let f = {$0(50, -10, 100)}(makeFunction(10))
println(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment