<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="">Hi all,<br class=""><div class=""><br class=""></div><div class="">I think that when used without the argument label it is not as clear what it does. For example:<div class=""><br class=""></div><div class=""><font face="Monaco" class=""><span style="font-size: 12px;" class="">nums.all { $0 % 2 == 0 }</span></font></div><div class=""><br class=""></div><div class="">can be interpreted as give me all the even elements.</div><div class=""><br class=""></div><div class="">So if the argument label were to be left out, then I would rename it. Some options:</div><div class=""><br class=""></div><div class=""><font face="Monaco" style="font-size: 12px;" class="">nums.allSatisfy { $0 % 2 == 0 }<span class="Apple-tab-span" style="white-space:pre">                </span>// All are even</font></div><div class=""><font face="Monaco" style="font-size: 12px;" class="">nums.allMatch { $0 % 2 == 0 }<span class="Apple-tab-span" style="white-space: pre;">                </span>// All are even</font></div><div class=""><font face="Monaco" style="font-size: 12px;" class="">nums.membersSatisfy { $0 % 2 == 0 }<span class="Apple-tab-span" style="white-space:pre">        </span>// All are even</font></div><div class=""><div class=""><font face="Monaco" style="font-size: 12px;" class="">nums.membersMatch { $0 % 2 == 0 }<span class="Apple-tab-span" style="white-space: pre;">        </span>// All are even</font></div></div><div class=""><div class=""><font face="Monaco" style="font-size: 12px;" class="">nums.elementsSatisfy { $0 % 2 == 0 }<span class="Apple-tab-span" style="white-space: pre;">        </span>// All are even</font></div><div class=""><font face="Monaco" style="font-size: 12px;" class="">nums.elementsMatch { $0 % 2 == 0 }<span class="Apple-tab-span" style="white-space: pre;">        </span>// All are even</font></div></div><div class=""><br class=""></div><div class="">Personally, I think I like nums.<font face="Monaco" style="font-size: 12px;" class="">allMatch { $0 % 2 == 0 }</font>. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 1, 2017, at 1:58 PM, Nevin Brackett-Rozinsky 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=""><div class="gmail_extra">If indeed “all(equal:)” is rarely needed, then perhaps it is best to leave it out *and also* leave out the argument label from “all(matching:)”. Then the signature would be similar to,</div><div class="gmail_extra"><br class=""></div><div class="gmail_extra"><font face="monospace, monospace" class="">func all(_ predicate: (Element)->Bool) -> Bool</font></div><div class="gmail_extra"><br class=""></div><div class="gmail_extra">and the points-of-use would look like:</div><div class="gmail_extra"><br class=""></div><div class="gmail_extra"><font face="monospace, monospace" class="">nums.all( isEven )</font></div><div class="gmail_extra"><font face="monospace, monospace" class="">nums.all{ $0 == 9 }</font></div><div class="gmail_extra"><font face="monospace, monospace" class="">nums.all{ n in n*n < 2 }</font></div><div class="gmail_extra"><br class=""></div><div class="gmail_extra">Nevin</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></div></body></html>