<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I agree with Radek, -1 on this.<div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><font color="#929292" class=""><br class="Apple-interchange-newline">Pozdrawiam – Regards,</font></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><font color="#929292" class="">Adrian Kashivskyy</font></div>
</div>
<br class=""><div style=""><blockquote type="cite" class=""><div class="">Wiadomość napisana przez Radosław Pietruszewski via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> w dniu 11.03.2016, o godz. 12:26:</div><br class="Apple-interchange-newline"><div class=""><div class=""><blockquote type="cite" class="">Would it make sense to allow mutable properties in structs, which could be mutated even by non-mutating methods?<br class=""></blockquote><br class="">This would break the whole mutability model of structs. The whole idea is: structs are always immutable, and you can mark things as “mutable”, but this can only happen if a struct is assigned to a mutable variable.<br class=""><br class="">— Radek<br class=""><br class=""><blockquote type="cite" class="">On 11 Mar 2016, at 11:38, Dan Raviv via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class="">Would it make sense to allow mutable properties in structs, which could be mutated even by non-mutating methods?<br class=""><br class="">I've noticed this could be useful when implementing a non-mutating protocol method. The method semantically doesn't change the state of the protocol's implementor, and therefore shouldn't be declared as mutating. However, *some* implementations might need to change some internal state for implementing the functionality. Making specific struct properties mutable for such a case could make sense.<br class=""><br class="">Alternatively, Swift could allow implementing a non-mutating protocol method as a mutating method in the implementor. Currently, this doesn't seem to be allowed; Swift doesn't recognize the mutating method as a match for the non-mutating protocol method.<br class=""><br class="">Cheers,<br class="">Dan<br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></blockquote><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></div></blockquote></div><br class=""></div></body></html>