<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Feb 19, 2017 at 5:55 PM, Adrian Zubarev <span dir="ltr">&lt;<a href="mailto:adrian.zubarev@devandartist.com" target="_blank">adrian.zubarev@devandartist.com</a>&gt;</span> 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"><div id="m_-975470251441810292bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">I don’t see it, can you elaborate a whole proposal first, otherwise I’m not convinced. Why?</div></div></blockquote><div><br></div><div>I&#39;m sorry. I&#39;m not sure what you mean. Can you clarify what you&#39;d like to be more convinced of?</div><div> </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"><span class=""></span><div><div class="h5"><p class="m_-975470251441810292airmail_on">Am 20. Februar 2017 um 00:51:18, Xiaodi Wu (<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>) schrieb:</p> <blockquote type="cite" class="m_-975470251441810292clean_bq"><span><div><div></div><div>





<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Sun, Feb 19, 2017 at 5:26 PM, Adrian
Zubarev <span dir="ltr">&lt;<a href="mailto:adrian.zubarev@devandartist.com" target="_blank">adrian.zubarev@devandartist.<wbr>com</a>&gt;</span>
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">
<div class="m_-975470251441810292m_1771436102870800877bloop_markdown">
<blockquote>
<p><span>Indeed, I have run into the same issue with this
and have a proposal idea saved up regarding anonymous enum cases
and subtyping relationships. It would not have been in-scope for
phase 1, so I did not write to the list about it. I’m short on time
these days, but eventually I’ll propose it unless someone else gets
to it first. However, this problem does not justify
<code>open</code> vs. <code>public</code>.</span></p>
</blockquote>
<p>Why is an anonymous enum case justifying the problem over a
closed protocol?</p>
</div>
</div>
</blockquote>
<div>It&#39;s justified because enums are (according to the Swift core
team) Swift&#39;s sum type. That is, when you want something to be
&quot;either X or Y&quot; (or &quot;one of X, Y, Z, or A&quot;), enums are intended to
provide all the facilities necessary to express that concisely and
with the greatest ease. As you recall from discussion about union
types, the core team has said that in circumstances where that goal
is not met (clearly, here), they welcome proposals to improve enums
so that they serve that use case. That is why anonymous enum cases
(or some other design to improve the experience of using enums as a
type for &quot;either X or Y&quot;) is justified.</div>
<div><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">
<div class="m_-975470251441810292m_1771436102870800877bloop_markdown">
<p>Can an anonymous enum case solve every problem a closed protocol
can?</p>
</div>
<div class="m_-975470251441810292m_1771436102870800877bloop_original_html"></div>
<div class="m_-975470251441810292m_1771436102870800877bloop_markdown"></div>
</div>
</blockquote>
</div>
Perhaps, perhaps not. The point is that you proposed a use case
purportedly to motivate closed protocols, and I am saying that it
is insufficient to justify closed protocols because the core team
has already stated that enums are intended to enable that use case.
So it is up to you, if you wish to promote this idea, to come up
with one or more compelling use cases and not for me or others to
enumerate every use case for them.</div>
</div>


</div></div></span></blockquote></div></div></div></blockquote></div><br></div></div>