Avatar
便利
7:14 AM
@swift-main struct Stone { var x: Int { get { return 1 } _modify { var xx: Int = 3 yield &xx y = xx } } var y: Int = 0 } func mod(_ x: inout Int) { x = 8 } func main() { var a = Stone() mod(&a.x) print(a.x) print(a.y) } main()