template statistics

Stefan Koch uplink.coder at googlemail.com
Thu Jun 4 09:30:47 UTC 2020


On Thursday, 4 June 2020 at 08:38:59 UTC, Jacob Carlborg wrote:
> On Wednesday, 3 June 2020 at 11:22:23 UTC, Stefan Koch wrote:
>> AND the user probably would rather have written a loop, but 
>> was forced by the language to use recursion.
>
> That's definitely true.
>
>> I will continue on type functions; if the conservative 
>> approaches don't work out.
>
> I hope we can get type functions.
>
> --
> /Jacob Carlborg

Well to be completely honest type functions do look cool.
But they to have a their own set of problems.
I designed them so it would be impossible to "abuse" them.
I did that by putting a restriction in that would disallow them 
from generating symbols.
And that does work and greatly simplifies the implementation.
However, it also so means that they can't be used in many places 
that you would like to use them.
For example creating a std.typecons.Tuple is impossible with type 
functions alone.
For such a task they can only be used to reduce the intermediate 
symbols within a template.
Which I fear will lead to some frustration.
Also you would need to rewrite your entire reflection framework 
to use typefunctions.
For that to be feasible new __traits have to be introduced.
.....

All in all even though the feature alone is not that heavy, it 
will need major additions to be useful.
I cannot do this alone.
The way I see it; If Walter is not in the boat the boat will not 
get anywhere.
It's to heavy for me to move by myself.


More information about the Digitalmars-d mailing list