Hacker News new | past | comments | ask | show | jobs | submit login

JS/TS has

    y = { ...x, change: 'b' }
And Swift avoids the mutability-problem all together, by providing structs with copy-on-write and self-mutating methods:

https://docs.swift.org/swift-book/documentation/the-swift-pr...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: