Should this work?

Regan Heath regan at netmail.co.nz
Fri Jan 24 03:56:05 PST 2014


On Fri, 24 Jan 2014 08:36:07 -0000, Stanislav Blinov  
<stanislav.blinov at gmail.com> wrote:

> On Friday, 24 January 2014 at 08:21:12 UTC, Jacob Carlborg wrote:
>> On 2014-01-23 21:53, Andrei Alexandrescu wrote:
>
>> I would expect "contains" to take a element and check if it exists in  
>> the range.
>>
>> I think "canFind" is just a weird name.
>
> I agree on the latter point. As for "contains"... Well, if we address  
> the terminology, we should consider that ranges are not really  
> containers, therefore "contains" would be slightly incorrect. Perhaps  
> "encounters" or "isWithin"? :)

This is the complete opposite of the point I was trying to make :p

I don't want a generic name/function, or a range specific name/function we  
already have the generic one, and probably a range one, I want a string  
specific one - in this particular example - with a name people will expect  
to find (pun intended) when doing string manipulation.

> On a serious note though, "contains" is leagues ahead of "canFind".

I think it depends on the context.

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list