logoalt Hacker News

jadsfwasdfsdyesterday at 3:42 PM2 repliesview on HN

> but in C, you pretty much always want the tag

We aren't discussing unions in memory layout, but in type systems. This also clearly indicates you aren't qualified for this discussion.


Replies

jesse__yesterday at 8:39 PM

I believe that, by the description provided, most languages that you're talking about must actually represent 'untagged unions' as tagged unions under the hood. See my sibling comment. I'm curious

cubefoxyesterday at 4:52 PM

To be fair, even Wikipedia talks about "untagged unions" only in the context of C. The terminology is confusing and the literature often out of date.