Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I strongly believe (waves hands while making incoherent small brained primate noises) that discriminated union types would be fabo for C as well.

Example why it would be sweet. Compiler could spit out a warning if it's not sure the correct union type is being used. Like if the pet union has dog and cat. Cat has respawn set initially to 9. Dog doesn't have respawn. If you try to set respawn without checking if it's a cat compiler whines about it.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: