Proposal: First class types (at compiletime)

Commander Zot no at no.no
Thu Aug 10 09:35:24 UTC 2023


On Thursday, 10 August 2023 at 04:13:57 UTC, Stefan Koch wrote:
> On Tuesday, 8 August 2023 at 12:26:06 UTC, sighoya wrote:
>>
>> If we could eliminate ambiguities, I would be definitely for 
>> it. Though we may need to know more about a type than just the 
>> name and the size.
>
> You need the origin so you can compute a mangle.
> f(t1, t2) needs to yield mangle_of(f) ~ mangle(t1) ~ mangle(t2)

you need the fully qualified name anyway, or else you run into 
ambiguities when turning it back into an alias. but i don't 
understand why you'd need the mangle.
your function signature should look like this, so the mangle 
shouldn't be anything special:
```
struct type_t { string fullyqualifiednameoftype; size_t 
sizeoftype; }
type_t fun(type_t, type_t);
```



More information about the Digitalmars-d mailing list