<div dir="ltr">Given that most popular languages seem to use the word "every" or "all" in the name of their analogous functions, I think it's very valuable to honor that legitimate user expectation if at all possible. I do believe the Swift API naming guidelines are not so rigid as to prohibit such a name.<div><br></div><div>While accurate, "onlyContains" lacks that familiarity. (A Google search of "onlyContains" turns up: "Study finds Subway's chicken only contains about 50 percent.")<br><div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 2, 2017 at 12:57 AM, Rien <span dir="ltr"><<a href="mailto:Rien@balancingrock.nl" target="_blank">Rien@balancingrock.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="gmail-"><br>
> On 02 Apr 2017, at 07:51, Karl Wagner via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
><br>
> Given the relationship to contains, why not keep it simple and go with:<br>
><br>
> onlyContains(_ element:)<br>
> onlyContains(_ matching:)<br>
><br>
> [9, 9, 9, 9, 9].onlyContains(9) // true<br>
> [1, 2, 3, 2, 3].onlyContains { $0 < 3 } // false<br>
><br>
> - Karl<br>
<br>
</span>IMO, we have a winner!<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
Rien.<br>
</font></span><div class="gmail-HOEnZb"><div class="gmail-h5"><br>
><br>
>> On 1 Apr 2017, at 10:47, Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>><br>
>> On Sat, Apr 1, 2017 at 3:40 AM, David Hart via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>><br>
>> On 1 Apr 2017, at 09:50, Brandon Trussell <<a href="mailto:brandon2k3@gmail.com">brandon2k3@gmail.com</a>> wrote:<br>
>><br>
>>> I agree that based on the method name, I thought a collection would be returned.<br>
>><br>
>> Now that I think more about it, I think you're right. It is confusing. Perhaps:<br>
>><br>
>> allAre(equalTo: )<br>
>> allAre(matching: )<br>
>><br>
>> Well, if we're going to go full stdlib naming guidelines, shouldn't they be--<br>
>><br>
>> ```<br>
>> areAll(equalTo:)<br>
>> areAll(matching:)<br>
>> ```<br>
>><br>
>>> On Sat, Apr 1, 2017 at 12:36 AM, David Hart via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>>><br>
>>><br>
>>> > On 1 Apr 2017, at 06:02, Will Stanton via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>>> ><br>
>>> > +1 to adding, but the name `all` suggests (to me) the return of another sequence, not a Bool.<br>
>>><br>
>>> I'm not too concerned because the mandatory labels makes it clear.<br>
>>><br>
>>> > Perhaps the function name should be question-like?<br>
>>> ><br>
>>> > Suggesting: `membersSatisfy(condition:)` or `allSatisfy(condition:)` or maybe even just `satisfies(condition:)`<br>
>>> > The question-like modifier/verb is necessary to suggest a Bool and IMO not a needless word.<br>
>>> ><br>
>>> > Regards,<br>
>>> > Will Stanton<br>
>>> ><br>
>>> >> On Mar 31, 2017, at 11:28, Ben Cohen via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>>> >><br>
>>> >> Hopefully non-controversial, aside from the naming of the method and arguments, about which controversy abounds<br>
>>> ><br>
>>> > ______________________________<wbr>_________________<br>
>>> > swift-evolution mailing list<br>
>>> > <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
>>> > <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
>>><br>
>>> ______________________________<wbr>_________________<br>
>>> swift-evolution mailing list<br>
>>> <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
>>> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Brandon<br>
>><br>
>> ______________________________<wbr>_________________<br>
>> swift-evolution mailing list<br>
>> <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
>> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> swift-evolution mailing list<br>
>> <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
>> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
><br>
> ______________________________<wbr>_________________<br>
> swift-evolution mailing list<br>
> <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
<br>
</div></div></blockquote></div><br></div></div></div></div>