Isn't `each` too much of a good thing?

Seb seb at wilzba.ch
Thu Sep 17 17:41:56 UTC 2020


On Thursday, 17 September 2020 at 16:18:18 UTC, Andrei 
Alexandrescu wrote:
>
> We support opApply with one, two, or more arguments. Built-in 
> hashtables (when was the last time you were in a place in your 
> life where hashtable.each was useful?). You name it - we 
> support it.

It's a standard library - catering for almost everything is in 
the job description ;-)

> This is in the same league with supporting enums that use 
> string as a base, as "some kinda sorta string thing".
>
> Too much!

I don't think anyone argues with you here.

> I have no idea how to improve this code because it will break 
> one of the suitably overspecialized unittests.

Well, more importantly there's a high chance it will break actual 
code.

> But this kind of stuff has no place in stdv2021.

The only way for this to ever happen is if we start with it. One 
function at a time.
I suggest simply creating a new repository and starting from zero.
Apart from the clear mental divide and separation, this has the 
added advantage that we can just keep druntime and phobos as is 
and work on a new combined "base" library. There are a few others 
like being able to immediately ship it via dub or being able to 
use GitHub's features (issues, projects, roadmaps, ...).

Also, as we're almost done with migrating off auto-tester, 
setting up the same CIs wouldn't be a big hassle and I would be 
happy to do so ;-)



More information about the Digitalmars-d mailing list