draft proposal for Sum Types for D

Basile B. b2.temp at gmx.com
Sat Dec 3 22:42:05 UTC 2022


On Saturday, 3 December 2022 at 17:50:19 UTC, H. S. Teoh wrote:
> On Sat, Dec 03, 2022 at 05:26:41PM +0000, Basile B. via 
> Digitalmars-d wrote: [...]
>> [...]
>
> I don't follow.  Whether or not the sum type is built into the 
> language, the tag has to be stored *somewhere*, your struct 
> size will not be compatible with C regardless.  Just because .a 
> uses a built-in sumtype does not make the tag disappear into 
> thin air, it will still exist in the struct and occupy space, 
> and the result is still not compatible with C because C does 
> not understand sumtypes.
>
> Either way, on the C side you have to declare the tag 
> explicitly and deal with it explicitly, regardless of whether 
> sumtypes are built into the language or not.
>
>
> T

I dont want `?.` to be related to that, which was proposed at the 
very beginning of this fork. Since the very beginning of this 
fork I explain that `ident?.` is something else.


More information about the Digitalmars-d mailing list