Skip to content

Instantly share code, notes, and snippets.

@adarapata
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save adarapata/56594a2e121278e1882c to your computer and use it in GitHub Desktop.

Select an option

Save adarapata/56594a2e121278e1882c to your computer and use it in GitHub Desktop.
swift楽しい
func makeIncrementer() -> (Int -> String, num: Int, Int -> Int) {
func addOne(number: Int) -> String {
return String(1 + number)
}
func addOneInt(number: Int) -> Int{
return number + 1
}
return (addOne, 5, addOneInt)
}
var increment = makeIncrementer()
increment.0(increment.1)
increment.2(2)
@adarapata
Copy link
Author

line 11: "6"
line 12: 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment