lemtoman@lemmy.ml to Rust Programming@lemmy.ml · 3 years agoAre there other languages that rust where enums can store data?message-squaremessage-square2fedilinkarrow-up18arrow-down11
arrow-up17arrow-down1message-squareAre there other languages that rust where enums can store data?lemtoman@lemmy.ml to Rust Programming@lemmy.ml · 3 years agomessage-square2fedilink
minus-squareEphera@lemmy.mllinkfedilinkarrow-up7·3 years agoYeah, in language theory, this kind of thing is called an “Algebraic Data Type”: https://en.wikipedia.org/wiki/Algebraic_data_type
Yeah, in language theory, this kind of thing is called an “Algebraic Data Type”: https://en.wikipedia.org/wiki/Algebraic_data_type