<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I'm against this.<div class=""><br class=""></div><div class="">In many cases, such 'one off' types are best expressed as nested types in some other type. I think we can get more mileage by fixing the cases where nested types are currently not supported, which would not require going through the evolution process, than adding new grammar to the language for yet another special case.</div><div class=""><br class=""></div><div class="">Slava</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 19, 2016, at 8:46 AM, Yong hee Lee via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi, I have a proposal.<div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">enum</span> Foo {</div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">case</span> foo,bar</div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;" class="">}</div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;" class=""><br class=""></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">func</span> test(a:<span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">Foo</span>) {</div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;" class=""> // …</div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;" class="">}</div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;" class=""><br class=""></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; color: rgb(52, 149, 175);" class="">test<span style="" class="">(.</span>bar<span style="" class="">)</span></div></div><div class=""><span style="" class=""><br class=""></span></div><div class=""><br class=""></div><div class="">If I use an enum only as a parameter of a function, the name of enum is redundant. </div><div class=""><br class=""></div><div class="">so I suggest a compact version like below.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">func</span> test(a:[<span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">foo</span>|bar]) {</div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;" class=""><span style="" class=""> </span><font color="#3495af" class="">// ...</font></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;" class="">}</div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;" class=""><br class=""></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">test</span>(.bar)</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;" class=""><span style="color: rgb(4, 51, 255);" class="">func</span> adjustTemperature(temp:[low|<font color="#3495af" class="">normal</font>|high]) {</div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;" class=""> <font color="#3495af" class="">// ...</font></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo;" class="">}</div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;" class=""><br class=""></div></div><div class=""><span style="font-family: Menlo; font-size: 16px;" class="">adjustTemperature</span><span style="font-family: Menlo; font-size: 16px;" class="">(.high)</span></div><div class=""><span style="font-family: Menlo; font-size: 16px;" class=""><br class=""></span></div><div class=""><span style="font-family: Menlo; font-size: 16px;" class=""><br class=""></span></div><div class=""><span style="font-family: Menlo; font-size: 16px;" class=""><br class=""></span></div><div class=""><span style="font-family: Menlo; font-size: 16px;" class="">I think this is very useful.</span></div><div class=""><font face="Menlo" size="3" class="">What do you think?</font></div><div class=""><font face="Menlo" size="3" class=""><br class=""></font></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>