If we assume that Swift was changed to be like Scala then:<div><br></div><div>    protocol Stored {</div><div>        let x = 42</div><div>    }</div><div><br></div><div>Would be equivalent to:</div><div><br></div><div>    protocol Stored {</div><div>        var x: Int { get }</div><div>        static func initX() -&gt; Int</div><div>    }</div><div><br></div><div>    extension Stored {</div><div>        static func initX() -&gt; Int { return 42 }</div><div>    }</div><div><br></div><div>If you then implemented the protocol:</div><div><br></div><div>    struct S: Stored {</div><div>        var x = 69 // Could be `let` instead of `var`</div><div>    }</div><div><br></div><div>Would be equivalent to:</div><div><br></div><div>    struct S: Stored {</div><div>        var x = S.initX()</div><div>        static func initX() -&gt; Int { return 69 }</div><div>    }</div><div><br></div><div>Therefore it is possible to unify the two concepts.<br><br>On Saturday, 30 January 2016,  &lt;<a href="mailto:davesweeris@mac.com">davesweeris@mac.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Not really… There’s a pretty big difference between “no setter” and “const&quot;. Plus, since we’re talking about protocols, “var … {get}” doesn’t even mean “no setter”, it means “no setter <i>required</i>”. A regular var property (which is obviously not constant) can satisfy a {get} requirement.<div><br></div><div><div>
- Dave Sweeris (Non-Canonical Dave)
</div>
<br><div><blockquote type="cite"><div>On Jan 29, 2016, at 22:49, Howard Lovatt via swift-evolution &lt;<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-evolution@swift.org&#39;);" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div>Scala uses their equivalent of let ... instead of var ... { get }. In Scala let ... Always means var ... { get }. Not a problem in Scala only having one concept. I think it is a possibility for Swift.<br><br>On Saturday, 30 January 2016, Brent Royal-Gordon via swift-evolution &lt;<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-evolution@swift.org&#39;);" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&gt; So what about protocols requiring ‘var … { get }’ syntax for read only properties? Is there some sort of underlying reason for this confusing syntax instead of ‘let …’? Now that Swift allows deferred initialization of lets does this requirement make sense?<br>
<br>
`let` doesn&#39;t mean &quot;no setter&quot;, it means &quot;constant&quot;. For instance, you can&#39;t make a `weak let`, because the `weak` implies the variable can be nilled. There&#39;s no way to require a constant in a protocol, but if there were one, that&#39;s what `let ...` would mean.<br>
<br>
--<br>
Brent Royal-Gordon<br>
Architechies<br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a>swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote><br><br>-- <br>  -- Howard.<br><br>
_______________________________________________<br>swift-evolution mailing list<br><a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-evolution@swift.org&#39;);" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br></div></div></blockquote></div><br><br>-- <br>  -- Howard.<br><br>