[swift-evolution] [Proposal] Allow enumerating cases in enumerations

Karl razielim at gmail.com
Wed Jul 6 09:40:36 CDT 2016


> On 4 Jul 2016, at 18:55, Anton Zhilin <antonyzhilin at gmail.com> wrote:
> 
> 2016-07-04 18:34 GMT+03:00 Karl via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>>:
> Now that you mention it; why is Bool not an enum?
>  
> Probably, for the same reason Int is not an enum.

Int could very well be an enum, but it would be too verbose because it has billions of possible values, and implementing arithmetic would get tricky.

Bool, on the other hand, is defined to have one of two values and has very limited arithmetic. It’s the perfect candidate for an enum.

Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160706/f8126c5d/attachment.html>


More information about the swift-evolution mailing list