Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
func g(_ x: inout Int) {
x = x * x
}
func f() {
var computed:Int {
get { return 5 }
set { print(newValue) }
}
g(&computed)
}
f() //prints 25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment