draft proposal for Sum Types for D

Timon Gehr timon.gehr at gmx.ch
Tue Nov 29 20:10:56 UTC 2022


On 11/29/22 21:04, Walter Bright wrote:
> On 11/29/2022 9:14 AM, Steven Schveighoffer wrote:
>> On 11/29/22 1:26 AM, Walter Bright wrote:
>>> Go ahead, Make My Day! Destroy!
>>>
>>> https://github.com/WalterBright/DIPs/blob/sumtypes/DIPs/1NNN-(wgb).md
>>
>> In Prior work, I suggest adding 
>> [TaggedAlgebraic](https://github.com/s-ludwig/taggedalgebraic) and I 
>> also suggest reading about how it works. I find it much nicer to use 
>> than std.sumtype.
>>
>> In the DIP, it says that "Member functions of field declarations are 
>> restricted the same way union member functions are." What does this 
>> mean? I can't find any information on this in the spec.
>>
>> An example of what is not allowed would be helpful.
>>
>> -Steve
> 
> I thought it mentioned that copy constructors, postblits, and 
> destructors are not allowed.

When the tag is managed by the language, you know which of those members 
to call under which circumstances, so this seems like an arbitrary 
limitation.


More information about the Digitalmars-d mailing list