Why is std.algorithm so complicated to use?

Jonathan M Davis jmdavisProg at gmx.com
Mon Jul 9 15:53:55 PDT 2012


On Monday, July 09, 2012 23:00:39 Timon Gehr wrote:
> On 07/09/2012 10:46 PM, bearophile wrote:
> > Jacob Carlborg:
> >> import std.algorithm;
> >> import std.range;
> >> 
> >> struct Foo {}
> >> 
> >> auto f = Foo();
> >> auto foos = [f];
> >> auto foo = foos.map!(x => "foo");
> >> auto bar = foo.chain("bar");
> > 
> > I suggest to always compile with "-wi -property".
> 
> Both -property and -w/-wi are broken and their only merit so far is to
> break my builds for no reason.
> 
> -wi spits out about 4000 lines of false (duplicate) warnings when run
> against my code base.

I'd actually argue the opposite. I think that they should be the normal 
behavior, and if you're getting a ton of warnings, I'd argue that you have a 
ton of problems that need fixing. dmd is generally good about not having 
useless warnings. Now, with the current version of github, it unfortunately 
seems to spit out a bunch of duplicate messages for the same error/warning 
with templates in a number of cases, and _that_ should be fixed, but the 
warnings themselves are generally solid and indicators of a real problem.

And as I've expressed in the past, I think that -property is very much doing 
the right thing and that not strictly enforcing properties is horrible, but 
obivously we're in disagreement on that.

- Jonathan M Davis


More information about the Digitalmars-d mailing list