Future of memory management in D
Rumbu
rumbu at rumbu.ro
Thu Nov 18 15:19:39 UTC 2021
On Thursday, 18 November 2021 at 15:00:22 UTC, JN wrote:
> On Thursday, 18 November 2021 at 14:56:40 UTC, rumbu wrote:
>>>> * pattern matching on fields/properties
>>>
>>> How would this work?
>>
>>
>> ```d
>> switch (JSONValue)
>> {
>> case JSONNumber n: writeln ("I have a number %s", n);
>> case JSONString s when s.Length > 100 : writeln("long
>> string");
>> case JSONString s: writeln("short string");
>> }
>>
>> ```
>
> Isn't that just std.sumtype/tagged union?
Yes, it is, but the question was about oop evolution in D and
keeping the pace with other languages, not about "here you have
another lib for this".
More information about the Digitalmars-d
mailing list