<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><span></span></div><div><div><span></span></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><span></span></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>Le 31 mars 2016 à 23:41, Douglas Gregor via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; a écrit&nbsp;:<br><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);">:</span></div><blockquote type="cite"><blockquote style="box-sizing: border-box; margin: 0px 0px 16px; padding: 0px 15px; border-left-width: 4px; border-left-style: solid; border-left-color: rgb(221, 221, 221); background-color: rgb(255, 255, 255);" class=""><div style="box-sizing: border-box; margin-top: 0px; margin-bottom: 0px;" class=""><font color="#777777" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3" class=""><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0036-enum-dot.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0036-enum-dot.md</a></font></div></blockquote></blockquote><br><div>Wondering if this fit more in the lexer/in-house coding style bucket.</div><div>For the supplied example of "badness", 'case heads', one can also write 'case Coins.heads' and with the latest Erica's pitch, one day 'case Self.heads'; are these also going to be disallowed?</div><div>I have always seen, the leading dot as an opt-in shortcut that the parser allowed us to use when the context/type can be inferred, and as such the usage of leading dot should probably be left to the user.</div><div><br></div><div>The problem I see from the example, is not the inconsistency with 'case heads' vs 'case .tails' (as coding style) but that you can define in the enum:</div><div><br></div><div>static let bluenose:Coin = .tails</div><div><br></div><div>And then use it &nbsp;in:</div><div>var coin:Coin = .bluenose</div><div>if coin == .bluenose { print("tails") }</div><div><br></div><div>But not in:</div><div>switch coin {</div><div>&nbsp; &nbsp; case .bluenose: print("tails")</div><div>&nbsp; &nbsp; default: print("heads")</div><div>}</div><div><br></div>Dany</div></div></div></body></html>