|
|
|
|
|
by randomdata
778 days ago
|
|
> Rust does have enums though It does not. You'll notice that if you read through your link. A tag-only union is not the same thing, even if you can find some passing similarities. If you mean it has enums like the Democratic People's Republic of Korea has a democracy, then sure, it does have enums in that sense. I'm not sure that gives us anything meaningful, though. If we're being honest, sum types are the better solution. Enums are hack for type systems that are too limited for anything else. They are not a feature you would add if you already have a sufficient type system. It's not clear why Rust even wants to associate itself with the hack that are enums, but your link shows that its author has a fundamental misunderstanding of what enums even are, so it may be down to that. To be fair, Swift made the same mistake, but later acknowledged it. It is interesting that Rust has chosen to double down instead. |
|
Why not? Seems to function the same way.