Redundancy of DRuntime and Phobos
Q. Schroll
qs.il.paperinik at gmail.com
Fri May 21 16:15:57 UTC 2021
I noticed that `core.internal.traits` contains a lot of stuff
that is exactly the same in `std.traits` and `std.meta`. Is that
for legacy reasons or should new additions be also redundant (and
why)?
For example, there's redundant `AliasSeq` which I understand
because it's kind of trivial and public-importing is on par with
it. (I'd still prefer the import.)
Another example is `Unconst`, `Unqual`,
`hasElaborate`*`Whatever`* that use a public import, but for
whatever reason, they encapsulate the import and make an
unnecessary template instance. None simply do
```D
public import core.internal.traits : Unconst;
```
but follow the pattern
```D
template Unconst(T)
{
import core.internal.traits : CoreUnconst = Unconst;
alias Unconst = CoreUnconst!(T);
}
```
I guess there's a good reason to do this and I'd like to
understand.
In `core.internal.traits` there is a lot of stuff commented with
"taken from". Why all this duplication? Are PRs to Phobos welcome
that public-import the `core` stuff? Are PRs to DRuntime welcome
that move improved stuff from Phobos to it (and replace the
Phobos stuff by a public import)?
More information about the Digitalmars-d
mailing list