[swift-evolution] Allowing mutable members in structs

Charles Constant charles at charlesism.com
Sat Mar 12 06:57:12 CST 2016


In general, I like things the way they are.

The only exception to this is that it would be nice occasionally to have an
easy way to make mutable computed property.

For example, to allow "array.first" or "array.last" to be mutable.

I have a feeling this would be difficult to implement (i.e.: most of Swift
is designed to pass values and structs as copies, so within your getter if
you as much as "var tempA = a" you ave a copy). Having said that, I have
had occasions where not being able to do so has annoyed me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160312/16d870e6/attachment.html>


More information about the swift-evolution mailing list