Elektrine lite

← Feed

@pinskia@hachyderm.io

2026-09-26 15:19 UTC

@brouhaha@mastodon.social @joe@f.duriansoftware.com They are not equivalent at all. They might seem related but ada variant changes in size depending on which variant is active.

Replies (1)

  • @brouhaha@mastodon.social 2026-09-26 15:27

    @pinskia@hachyderm.io @joe@f.duriansoftware.com If an Ada record has a default discriminant, you can in fact change the variant by a full assignment (not by individual components, or just the discriminant), so it really is an algebraic sum type. Back when I was programming in Ada professionally, I used that a lot! Obviously the record can't contain an unconstrained array, as then there is no size that can hold all variants.

    Open ##5219701