Just for the sake of completeness... :)<br><br>  open open(set) var open_open = &quot;&quot;i<br>  open public(set) var open_public = &quot;&quot;<br>  open internal(set) var open_internal = &quot;&quot;<br>  open fileprivate(set) var open_fileprivate = &quot;&quot;<br>  open private(set) var open_private = &quot;&quot;<br>  public public(set) var public_public = &quot;&quot;<br>  public internal(set) var public_internal = &quot;&quot;<br>  public fileprivate(set) var public_fileprivate = &quot;&quot;<br>  public private(set) var public_private = &quot;&quot;<br>  internal internal(set) var internal_internal = &quot;&quot;<br>  internal fileprivate(set) var internal_fileprivate = &quot;&quot;<br>  internal private(set) var internal_private = &quot;&quot;<br>  fileprivate fileprivate(set) var fileprivate_fileprivate = &quot;&quot;<br>  fileprivate private(set) var fileprivate_private = &quot;&quot;<br>  <br>  private private(set) var private_private = &quot;&quot;<br><br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 10, 2017 at 12:36 PM Adrian Zubarev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><div class="m_6448750450359237036bloop_markdown gmail_msg"><p class="gmail_msg">How about just using this?</p>

<pre class="gmail_msg"><code class="m_6448750450359237036swift gmail_msg">struct MyType {
    public fileprivate(set) var timestamp: Date
}
</code></pre>

<p class="gmail_msg"></p></div><div class="m_6448750450359237036bloop_original_html gmail_msg"></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="m_6448750450359237036bloop_original_html gmail_msg"><div id="m_6448750450359237036bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto" class="gmail_msg"><br class="gmail_msg"></div> <br class="gmail_msg"> <div id="m_6448750450359237036bloop_sign_1486748072496395008" class="m_6448750450359237036bloop_sign gmail_msg"><div style="font-family:helvetica,arial;font-size:13px" class="gmail_msg">-- <br class="gmail_msg">Adrian Zubarev<br class="gmail_msg">Sent with Airmail</div></div></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="m_6448750450359237036bloop_original_html gmail_msg"> <br class="gmail_msg"><p class="m_6448750450359237036airmail_on gmail_msg">Am 10. Februar 2017 um 18:33:35, Pasquale Ambrosini via swift-evolution (<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>) schrieb:</p> <blockquote type="cite" class="m_6448750450359237036clean_bq gmail_msg"><span class="gmail_msg"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"></div><div class="gmail_msg">






Hi guys,
<div class="gmail_msg">My idea is simple, put an access level control token
to the setter of a var</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">Right now, we are likely to do something like this in
order to hide the setter:</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">
<div style="margin:0px;font-size:20px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">fileprivate</span> <span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">var</span>
<span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">_timestamp:</span> <span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">Date</span>
<span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">=</span> <span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">Date</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">()</span></div>
<p style="margin:0px;font-size:20px;line-height:normal;font-family:Menlo;min-height:24px" class="gmail_msg"><br class="m_6448750450359237036webkit-block-placeholder gmail_msg"></p>
<div style="margin:0px;font-size:20px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">public</span> <span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">var</span>
<span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">timestamp:</span> <span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">Date</span>
<span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">{</span></div>
<div style="margin:0px;font-size:20px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">return</span> <span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">self</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">_timestamp</span></div>
<div style="margin:0px;font-size:20px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">}</span></div>
</div>
<div style="margin:0px;font-size:20px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px" class="gmail_msg"><br class="gmail_msg"></span></div>
<div style="margin:0px;font-size:20px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px" class="gmail_msg">The idea is to do it without using another var, like
this:</span></div>
<div style="margin:0px;font-size:20px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px" class="gmail_msg"><br class="gmail_msg"></span></div>
<div style="margin:0px;line-height:normal" class="gmail_msg">
<div style="font-family:Menlo;font-size:20px;margin:0px;line-height:normal" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">public</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">var</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> timestamp: </span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">Date</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> {</span></div>
<div style="font-family:Menlo;font-size:20px;margin:0px;line-height:normal" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">get { </span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">return</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">self</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">.</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">_timestamp
}</span></div>
<div style="font-family:Menlo;font-size:20px;margin:0px;line-height:normal" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">fileprivate set(newValue) { _timestamp = newValue
}</span></div>
<div style="font-family:Menlo;font-size:20px;margin:0px;line-height:normal" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">}</span></div>
<div style="font-family:Menlo;font-size:20px;margin:0px;line-height:normal" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px" class="gmail_msg"><br class="gmail_msg"></span></div>
<div style="margin:0px;line-height:normal" class="gmail_msg">In this way
the setter will be available “locally” in the file but it will
not be accessible from outside.</div>
<div style="margin:0px;line-height:normal" class="gmail_msg">The only
problem that I can see is how to reference the var itself? As you
can see I used  “_timestamp” like Objective-C, but there
should be another way to do reference it.</div>
<div style="margin:0px;line-height:normal" class="gmail_msg"><br class="gmail_msg"></div>
<div style="margin:0px;line-height:normal" class="gmail_msg"><br class="gmail_msg"></div>
<div style="margin:0px;line-height:normal" class="gmail_msg">
Cheers,</div>
<div style="margin:0px;line-height:normal" class="gmail_msg"><br class="gmail_msg"></div>
<div style="margin:0px;line-height:normal" class="gmail_msg">
Pascal</div>
<div style="font-family:Menlo;font-size:20px;margin:0px;line-height:normal" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"><br class="gmail_msg"></span></div>
</div>
<div style="margin:0px;font-size:20px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px" class="gmail_msg"><br class="gmail_msg"></span></div>
<div style="margin:0px;font-size:20px;line-height:normal;font-family:Menlo" class="gmail_msg"><br class="gmail_msg"></div>
<div style="margin:0px;font-size:20px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px" class="gmail_msg"><br class="gmail_msg"></span></span></div>
<div style="margin:0px;font-size:20px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"><span style="font-family:Helvetica;font-size:12px" class="gmail_msg"><br class="gmail_msg"></span></span></div>
<div class="gmail_msg"><br class="gmail_msg"></div>


_______________________________________________<br class="gmail_msg">swift-evolution mailing list<br class="gmail_msg"><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg"></div></div></span></blockquote></div></div>_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>