<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Because returning a usable function reference is more useful than just a string describing the argument types, at least for most common use cases.</div><div id="AppleMailSignature">--</div><div id="AppleMailSignature">Richard</div><div><br>On Feb 18, 2016, at 10:33 AM, Joao Nunes via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8">Richard,<div class=""><br class=""></div><div class="">Why not the following?</div><div class=""><br class=""></div><div class="">enum Foo {<br class=""> case Bar(String)<br class=""> case Baz(Int)<br class="">}<br class=""><br class="">let cases: [String: Any] = Foo.allCases <br class="">print(cases)<br class="">// [.Bar(String), .Baz(Int)]</div><div class=""><br class=""></div><div class="">João Nunes</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 18 Feb 2016, at 20:22, Erica Sadun <<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</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="">I'd really like to see the count / collection thing happen.<div class=""><br class=""></div><div class="">-- E</div><div class=""><br class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 18, 2016, at 11:08 AM, Ross O'Brien 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=""><div dir="ltr" class="">João,<div class=""><br class=""></div><div class="">your proposal has been proposed before, but I don't think it's been formally submitted for review yet:</div><div class=""><a href="https://github.com/jtbandes/swift-evolution/blob/977a9923fd551491623b6bfd398d5859488fe1ae/proposals/0000-derived-collection-of-enum-cases.md" class="">https://github.com/jtbandes/swift-evolution/blob/977a9923fd551491623b6bfd398d5859488fe1ae/proposals/0000-derived-collection-of-enum-cases.md</a><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Feb 18, 2016 at 5:57 PM, João Nunes <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br class="">
<br class="">
I have one proposal for the language to add a property to enums with the total number of cases.<br class="">
<br class="">
Example:<br class="">
<br class="">
enum Section {<br class="">
case Tag<br class="">
case Article<br class="">
}<br class="">
<br class="">
let cases = Section.caseCount<br class="">
<br class="">
This would be extremely useful when using enums for tableviews.<br class="">
<br class="">
What do you think?<br class="">
<br class="">
<br class="">
João Nunes<br class="">
<br class="">
Sent from my iPhone<br class="">
_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</blockquote></div><br class=""></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>