<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 20, 2016, at 9:01 AM, Jacob Bandes-Storch via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I've been thinking about naming a bit. I'm worried that "values" / "allValues" won't make sense if this feature eventually goes in the direction of returning type constructors. For enums with associated types, the cases may actually be <b class="">functions</b> taking the associated type and returning the enum type. (There's an example under "Future directions" in the proposal). Calling these "values" seems strange to me, but calling them "cases" makes sense.</div></div></blockquote><div><br class=""></div><div>That seems like a fairly specialized use case to me. I'd expect the default behavior for enums with associated values to enumerate all possible values of each case (whose associated values would themselves need to be ValueEnumerable), not the case constructors themselves. That's more generally useful when using associated values to categorize constants.</div><div><br class=""></div><div>-Joe</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="">Even though the "case" <i class="">keyword</i> is mostly used with enums, I think the actual English <i class="">word</i> "case" applies pretty well when thinking about any type, not just enums. It refers to a member of the type. T.cases or T.allCases are all the cases of valid instances/members of the type.</div><div class=""><br class=""></div><div class="">"FiniteType" is technically accurate, but to me it doesn't evoke "this protocol allows you to enumerate the type's values". I'm leaning toward the names that end in -Enumerable.</div><div class=""><br class=""></div><div class="">Unless someone has a compelling argument otherwise, I may leave the naming as-is in the proposal, and let the core team bikeshed it to their liking :)<br class=""><div class="gmail_extra">
<br class=""><div class="gmail_quote">On Wed, Jan 20, 2016 at 8:45 AM, Denis Nikitenko <span dir="ltr" class="">&lt;<a href="mailto:d.nikitenko@icloud.com" target="_blank" class="">d.nikitenko@icloud.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">For the protocol name, I rather like FiniteType (or FiniteValueType), since I find it to be more general and future-proof.&nbsp; ValueEnumerable would also work, though.<br class="">
<br class="">
My preference for the static var would be T.values or T.allValues - we want to get all values of the finite type T.<br class="">
<br class="">
Definitely a +1 on the overall proposal.<br class="">
<span class=""><br class="">
<br class="">
<br class="">
&gt;&gt; On Jan 18, 2016, at 11:15 PM, Jacob Bandes-Storch via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:<br class="">
&gt;&gt;<br class="">
&gt;&gt;<br class="">
&gt;&gt; OK, I can see the argument here. I was worried about making this proposal so broad that it wouldn't be seriously considered, but I agree that choosing more general names will open it up to future expansion.<br class="">
&gt;&gt;<br class="">
&gt;&gt; Here are some more name ideas:<br class="">
&gt;&gt;<br class="">
&gt;&gt; - CaseEnumerable (in the proposal draft)<br class="">
&gt;&gt; - T.cases (in the proposal draft)<br class="">
&gt;&gt; - T.allCases<br class="">
&gt;&gt; - FiniteType (as you suggested)<br class="">
&gt;&gt; - FiniteValueType<br class="">
&gt;&gt; - ValueEnumerable<br class="">
&gt;&gt; - T.values<br class="">
&gt;&gt; - T.allValues<br class="">
&gt;&gt;<br class="">
&gt;&gt; Thoughts? More suggestions? I think I like ValueEnumerable.<br class="">
&gt;&gt;<br class="">
&gt;<br class="">
</span><div class=""><div class="">&gt; _______________________________________________<br class="">
&gt; swift-evolution mailing list<br class="">
&gt; <a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class="">
</div></div></blockquote></div><br class=""></div></div></div></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>