[swift-evolution] Proposal: Auto-implemented computed properties

Stephen Celis stephen.celis at gmail.com
Fri Dec 11 14:09:42 CST 2015


On Fri, Dec 11, 2015 at 2:20 PM, Nathan Yee via swift-evolution <
swift-evolution at swift.org> wrote:

> In the following case, the computed property 'x' can only be set in the
> initializer.
>
> class Foo {
>     init(x: Double) {
>         self.x = x
>     }
>     var x: Double { get }
> }
>

Why not just use `let`?

Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151211/257f3751/attachment.html>


More information about the swift-evolution mailing list