Does D have too many features?

Adam D. Ruppe destructionator at gmail.com
Sat Apr 28 14:20:42 PDT 2012


On Saturday, 28 April 2012 at 18:48:18 UTC, Walter Bright wrote:
> What's your list?

I think most the responses to this thread are insane.

But, there is one thing I don't think D needs: new.
I'm pretty sure it could be done in the library now
that we have robust templates, which I think would open
up some nice things.

Suppose:

module std.typecons;
NotNull!T new(T, Args...)(Args args) {
     return assumeNotNull(core.gc.new!T(args));
}

module core.gc;
T new(T, Args...)(Args args) {
  // implement the new we know now
}



And so on, then you could get new allocators
just by changing which module you import new from.



We could kinda sorta do it now, but it wouldn't be
as consistent, and of course, the name "new" is unavailable.


More information about the Digitalmars-d mailing list