Overloads not returning appropriate info. [Field reflunkory]

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Apr 9 18:56:58 UTC 2019


On Tue, Apr 09, 2019 at 06:33:21PM +0000, Seb via Digitalmars-d-learn wrote:
> On Tuesday, 9 April 2019 at 16:30:53 UTC, Alex wrote:
> > On Tuesday, 9 April 2019 at 14:59:03 UTC, Adam D. Ruppe wrote:
> > > [...]
> > I didn't say the language. The point with the language is that it
> > could have built in semantics to do reflection in a inform
> > way(__traits is somewhat uniform but messy and then one has
> > std.traits which then makes it not uniform).
> > 
> > [...]
> 
> Have you considered writing a DIP?

I think the original intent was that __traits was supposed to be
low-level, implementation-specific calls into the compiler, while
std.traits is supposed to be the user-friendly syntactic sugar built on
top that user code is supposed to use.

Unfortunately, it turned out that people prefer using __traits directly
instead, and std.traits hasn't quite been keeping up with new __traits
(e.g., AFAIK __traits(compiles) does not have a std.traits equivalent),
and is also less familiar to many people, so now we have a mishmash of
code sometimes using __traits and sometimes std.traits.


T

-- VI = Visual Irritation


More information about the Digitalmars-d-learn mailing list