Interesting new Swift keyword I learned about today: "nonmutating."
e.g. UnsafeMutablePointer's
var memory: T { get nonmutating set }
Conversation
I just discovered this myself. I'm using an enum to manage app defaults, and now I can…
AppDefault.Bounciness.intValue = 5
1
Yikes. What does that mean? Have a gist?
1
1
1
Yes. :)
That setter *is* mutating. This will break compilation semantics.
4
Hah! That's fair. I'd consider it nonmutating, though, because it doesn't change the instance itself, just global state. No?
1
Replying to
Hm. I think you’re right, actually!

