[swift-evolution] Draft Proposal: count property for enum types

David Sweeris davesweeris at mac.com
Wed Jan 20 10:31:18 CST 2016


Just a quick note regarding case names... Using string interpolation already does that *if* your enum does *not* conform to CustomStringConvertible. If Swift had a way "undo" protocol conformance, we'd get that for free. Something like:
"\(MyEnum.foo without CustomStringConvertible)" or "\(MyEnum.foo as !CustomStringConvertible)"

- Dave Sweeris

> On Jan 20, 2016, at 07:47, Martin Crossley via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Excellent news!
> 
> Sent from my iPhone
> 
>> On 20 Jan 2016, at 02:43, Arthur Ariel Sabintsev <arthur at sabintsev.com> wrote:
>> 
>> +1 from me as well. Proposed solution works very well. I'd personally prefer some convenience methods on enum to directly return array/count, but the solution proposed is more 'Swift'y.
>> 
>>> On Tue, Jan 19, 2016 at 8:33 PM Jacob Bandes-Storch <jtbandes at gmail.com> wrote:
>>> You can see the latest proposal draft at https://github.com/jtbandes/swift-evolution/blob/case-enumerable/proposals/0000-derived-collection-of-enum-cases.md
>>> 
>>> And the discussion in this thread: https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160111/006876.html
>>> 
>>> Jacob Bandes-Storch
>>> 
>>>> On Tue, Jan 19, 2016 at 5:29 PM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
>>> 
>>>> > Why does it fizzle out?
>>>> 
>>>> Well, there's now a concrete proposal in the thread "Pre-proposal: CaseEnumerable protocol (derived collection of enum cases)", so it seems like we've broken this pattern.
>>> 
>>>> 
>>>> --
>>>> Brent Royal-Gordon
>>>> Architechies
>>>> 
>>> 
>>>> _______________________________________________
>>>> swift-evolution mailing list
>>>> swift-evolution at swift.org
>>>> https://lists.swift.org/mailman/listinfo/swift-evolution
>> 
>> -- 
>> Best,
>> 
>> Arthur / Sabintsev.com
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160120/f7255428/attachment.html>


More information about the swift-evolution mailing list