Should this work?

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


On Thu, 23 Jan 2014 20:53:01 -0000, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> On 1/23/14 8:06 AM, Regan Heath wrote:
>> This.  Not my position.  Rather I am suggesting we identify individual
>> omissions (like std.string.contains) and add an alias.  So that people
>> don't have to struggle quite so much when switching to D.  The lower the
>> bar and all that..
>
> Ionno. Just look at the current morass with  
> https://github.com/D-Programming-Language/phobos/pull/1875. We have two  
> names for the same function "canFind" and "any". Then we want to  
> deprecate one, but look at how much impact it's having on Phobos alone.  
> Are you sure you want to add a _third_?

Not *quite* the same.  Any is/was in the same module as canFind and for  
use in the exact same context.  A string specific "contains" would only be  
used in the context of string parsing.  If contains existed in std.string  
then it would be unusual for anyone to use canFind on a string (in a  
string only context).

That's what I'm suggesting, not adding more generic aliases/names for  
existing functions (as Any was) but adding specific names in specific  
contexts for otherwise generic functions with odd generic names, like  
canFind.

R

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


More information about the Digitalmars-d mailing list