On Saturday, 25 January 2014 at 09:18:24 UTC, Manu wrote:
I would expect "contains" to take a element and check if it exists in the
range.
Except in the case of string, where we also want an overload taking more
than a single element aka a substring.
A great example of when the string function should not be conflated with
the general function.
You always want the overload.
If this works:
contains("hello", "el");
then this should work:
contains([1, 2, 3, 4, 5], [2, 3]);
Special cases are pure evil. There's nothing special about strings in this case.