News for hackers. Stuff that matters.
Re:Should I use a Swift struct or a class? by yawaramin on Saturday July 04, 2015 @01:16PM (#9830797)
The point is that you don't always want to mark the method as mutating. This is explained in the article.
Re:Should I use a Swift struct or a class? by mikeash on Saturday July 04, 2015 @08:42PM (#9832086)
This is described in the article. I wouldn't say that it's explained. It makes no sense to me. Whether a method mutates state should be evident when you make it. The very concept of a value-type method which mutates state but isn't marked as mutating makes no sense at all. It sounds like it might be a case where you actually wanted reference semantics but accidentally used value semantics and are trying to make it work anyway.