[swift-evolution] [Discussion] Enum Leading Dot Prefixes

David Hart david at hartbit.com
Sun Feb 14 10:02:32 CST 2016


But the dot prefix is not a specificity of enum cases: it’s the case (no pun intended) for all static members. So I don’t understand why you would suggest using it for the declaration of enum cases. It would un-necessarily tie dot prefix with Enums and hide for newcomers the fact it can also be used for other static members.

> On 13 Feb 2016, at 19:02, T.J. Usiyan via swift-evolution <swift-evolution at swift.org> wrote:
> 
> The honest and lazy truth? Muscle memory.  I type `case .<Foo>` much more than `case <Foo>` so I tend to pause during declaration more often than I would like. I can let it go now that I have floated the idea but that was the reason I pitched it.
> TJ
> 
> On Fri, Feb 12, 2016 at 10:57 AM, Erica Sadun via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> Are there any reasons why it makes sense to add them to the declaration? There's no other place in the language where a member is declared (vs referenced) using a dot prefix so I'd personally lean towards "no". 
> 
> -- Erica
> 
>> On Feb 11, 2016, at 11:41 PM, Carlos Parada <carlosparada at me.com <mailto:carlosparada at me.com>> wrote:
>> 
>> Taking consistency further, should the definition also use dot prefixes? For example:
>> 
>>> enum Coin {
>>>     case .Heads, .Tails
>>>     func printMe() {
>>>         switch self {
>>>         case .Heads: print("Heads")
>>>         case .Tails: print("Tails")
>>>         }
>>>     }
>>> }
>> 
>> — Carlos Parada
> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
> 
> 
> _______________________________________________
> 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/20160214/afe9c761/attachment.html>


More information about the swift-evolution mailing list