<div dir="ltr">I think we have the same question as with the "sealed" classes by default proposal. To allow or not extension of the public API by the user (at least by default).</div><br><div class="gmail_quote"><div dir="ltr">El jue., 30 jun. 2016 a las 16:10, Edward Valentini via swift-evolution (<<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Existing switch statements would have to be modified to add a default statement. Additionally enums could be marked final to disallow case option expansion<br>
<br>
<br>
<br>
On Jun 30, 2016, at 16:04, David Sweeris <<a href="mailto:davesweeris@mac.com" target="_blank">davesweeris@mac.com</a>> wrote:<br>
><br>
> By itself, this would break switch statements, since they have to be exhaustive.<br>
><br>
> If anyone has any ideas about how to fix that, I'm all ears.<br>
><br>
> - Dave Sweeris<br>
><br>
>> On Jun 30, 2016, at 14:58, Edward Valentini via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
>><br>
>><br>
>> I am finding myself in a situation where the most elegant "swifty" solution would be to allow enum extensions to add to existing case options. For example lets say I'm using a library that has the following enum defined:<br>
>><br>
>> enum MyDirection {<br>
>> case east, west<br>
>> }<br>
>><br>
>> My app for example also makes use of north and south, so I would love to be able to write:<br>
>><br>
>> extension MyDirection {<br>
>> case north,south<br>
>> }<br>
>><br>
>> In objective c, one would probably have defined constants like MyDirectionEast etc... these would probably have been mapped to ints or strings so a consumer of this library could have easily extended this to add additional functionality, but using constants like that is not very "swifty"<br>
>><br>
>> I'm curious what the swift community thinks.<br>
>><br>
>> Thank you<br>
>> _______________________________________________<br>
>> swift-evolution mailing list<br>
>> <a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
>> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>