[swift-evolution] Consolidate Code for Each Case in Enum

Jay Abbott jay at abbott.me.uk
Thu Jan 12 12:15:23 CST 2017

Thanks for pointing this out Tim. I had actually read the whole thread but
over a few days between other things and must have missed the relevant

I think you may be reacting to the very first draft. `extension` isn't used
> at all in the newest draft, and no code can exist outside the enum. In
> fact, there's a fair amount of similarity to your idea in the newest
> proposal.
> https://gist.github.com/timshadel/5a5a8e085a6fd591483a933e603c2562
Oh yes - this is much better! Lovely in fact. Although it does lose the
benefit of at-a-glance understanding of the cases present in the enum when
they are on one line each (when the code gets bigger than in the example
they will be quite a way apart).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170112/9b905a59/attachment.html>

More information about the swift-evolution mailing list