LingDong- / wax

A tiny programming language that transpiles to C, C++, Java, TypeScript, Python, C#, Swift, Lua and WebAssembly 🚀
https://waxc.netlify.app/
MIT License
793 stars 45 forks source link

representing unions/enums #19

Open johnynek opened 3 years ago

johnynek commented 3 years ago

Have you given any thought to how one can represent a tagged union/enum: so, we either have struct1, struct2, etc..?

In C this can be done with a struct with a field holding a tag, and then a field that is the union of all the other possibilities.

It would be very interesting to have this ability in wax.