Metaprogramming without templates

Stefan Koch uplink.coder at googlemail.com
Mon Jun 21 12:21:51 UTC 2021


On Monday, 21 June 2021 at 11:42:47 UTC, jmh530 wrote:
> On Monday, 21 June 2021 at 11:37:31 UTC, Basile B. wrote:
>> [snip]
>>
>> ok I did not get that. Sorry for the off topic ;)
>
> I'm not sure how off topic it is...I had the same question. I 
> didn't really understand what was going on...still not sure I 
> do...
>
> The main question I would have for Stefan would be how exactly 
> this relates to type functions.

For me it's a different take on type functions.
Type functions rely on a lot of un-inspectable compiler magic.
And while I think that they are intuitive you cannot easily see 
which introspection information you have access to.
Type functions are blending the syntax of types as types with 
types as values.
Creating hard to solve issues.
for example
```
type T = int;
pragma(msg, T.mangleof); // should this be the mangle of the 
Variable T ? or should it be the mangle of int?
```

`core.reflect` on the other hand declares what exactly you get 
back, what fields it has and which functions can be called on it.



More information about the Digitalmars-d mailing list