bettersum (v0.7.0): mixin-based sumtypes
DanielG
simpletangent at gmail.com
Wed Oct 7 02:51:36 UTC 2026
Oh, and if you're concerned about compilation speed: quote your D
types in the sumtype definition with backticks - it will
short-circuit most of the parsing:
```d
mixin(sumtype(q{
Thing {
// backticks for speed:
Value1(`int function(const(int*)[], immutable(int[int])*)[]`
whatever)
}
}));
```
The reason I made it parse D types at all, is so they could
appear normally in `q{}` strings, and benefit from syntax
highlighting. But if you don't care about that - backtick-quote
away!
More information about the Digitalmars-d-announce
mailing list