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

David Waite david at alkaline-solutions.com
Sat Feb 13 14:29:05 CST 2016


Erica,

The current spec has the following line:

> static func staticFunc2() { let foo = .Tails } // requires leading dot

The leading dot requirement does not exist today for references to static properties and functions from a static function.

Is your proposal to:
- require a dot in front of static properties/functions in this case as well for consistency across all static things
- require a dot only in front of the case statements, to promote consistency only for use of cases within an enum
- or, do you wish to change your mind about this particular case?

-DW

> On Feb 13, 2016, at 12:31 PM, Erica Sadun via swift-evolution <swift-evolution at swift.org> wrote:
> 
> No. The wildcard match does not require a dot prefix.
> 
> -- E
> 
> 
>> On Feb 13, 2016, at 10:40 AM, Paul Ossenbruggen via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 
>> I am assuming there would be no dot in front of _? 
>> 
>> 
>> switch value {
>> 	case .A: “A”
>> 	case .B: “B”
>> 	case ._:”D” // this is not correct?
>> }
>> 
>> 
>>> On Feb 13, 2016, at 9:18 AM, Joseph Lord via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>> 
>>> +1
>>> 
>>> Didn't even know it was legal. Definitely increases consistency and simplifies the language. 
>>> 
>>> J
>>> 
>>> On Feb 12, 2016, at 3:00 AM, Erica Sadun via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>> 
>>>> https://gist.github.com/erica/e0b8a3a22ab716a19db4 <https://gist.github.com/erica/e0b8a3a22ab716a19db4>
>>>> 
>>>> Requiring Leading Dot Prefixes for Enum Instance Member Implementations
>>>> 
>>>> 
>>> _______________________________________________
>>> 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 <mailto:swift-evolution at swift.org>
>> 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/20160213/394ca378/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4139 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160213/394ca378/attachment.p7s>


More information about the swift-evolution mailing list