TypeFunction example creatiing a conversion matrix

Stefan Koch uplink.coder at gmail.com
Fri Oct 2 04:25:32 UTC 2020


On Friday, 2 October 2020 at 04:05:00 UTC, Andrei Alexandrescu 
wrote:
>
> That's a rather large change - ref to aliases and such. Maybe a 
> more basic facility such as appending to a tuple is simpler?

I doubt it.
Compiler Tuples are somewhat hard to model in a polymorphic 
context.
They are essentially monads because they can't be modified.
Also you cannot preallocate a tuple.
And they can only work inside polymorphic contexts.

To be able to append to them you quite likely need strict order 
of declaration rules, as well as changes to D's compilation model 
as a whole.

Type functions or "static tuple emission functions" represent an 
addition, rather than a modification.
Which should make it much more tractable, to reason about them 
than to reason about large scale language changes.

YMMV of course.



More information about the Digitalmars-d mailing list