I accept "contains" for at least match one result, similar to OR.
"containsOnly" is similar to AND for one element or more elements must
contain same values and types.

On Thursday, April 6, 2017, Xiaodi Wu via swift-evolution <
[email protected]> wrote:

> In JavaScipt they are known as "every" and "includes".
>
> In C# they are "TrueForAll" and "Exists".
>
> Not sure why "all" and "contains" is any less consistent.
> On Thu, Apr 6, 2017 at 05:50 Víctor Pimentel Rodríguez via swift-evolution
> <[email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>
>> On Thu, Apr 6, 2017 at 12:44 AM, Jonathan Hull via swift-evolution <
>> [email protected]
>> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>>
>>> On that note: ‘containsOnly' is still my favorite by a wide margin.  I
>>> know it is longer than ‘all’, but it’s behavior is much clearer (especially
>>> for those of us who have never used or heard of ‘all’ in other languages),
>>> and it’s relationship with ‘contains’ is also very clear.
>>>
>>
>> Also +1 to containsOnly for this very reason.
>>
>> In other languages (Python, Ruby, etc) that have an `all` method, they
>> also have an `any` method, thus maintaining certain consistency.
>>
>> In the Swift standard library that `any` method is called `contains`, so
>> `containsOnly` matches nicely that consistency.
>>
>> --
>> Víctor Pimentel
>> _______________________________________________
>> swift-evolution mailing list
>> [email protected]
>> <javascript:_e(%7B%7D,'cvml','[email protected]');>
>> https://lists.swift.org/mailman/listinfo/swift-evolution
>>
>
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to