Should this work?
Peter Alexander
peter.alexander.au at gmail.com
Sat Jan 25 06:23:47 PST 2014
On Saturday, 25 January 2014 at 11:43:03 UTC, Ola Fosheim Grøstad
wrote:
> On Saturday, 25 January 2014 at 10:15:30 UTC, Peter Alexander
> wrote:
>> 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.
>
> I don't disagree, but naming and intuitive semantics should
> match up. In this case it does not. "contains" signifies set
> membership.
>
> hasSequence/findSequence would be more appropriate
100% agree. The key thing is that it should be consistent between
strings and other range types.
More information about the Digitalmars-d
mailing list