News for hackers. Stuff that matters.
Re:Virtual Structs Part 1: Where Rust’s Enum Shines by pcwalton on Tuesday May 05, 2015 @03:11PM (#9494306)
> An enum, short for enumeration, shouldn't hold data, else don't call it an enum.

They can in Java. Java's about as mainstream of a programming language as you can think of.

Re:Virtual Structs Part 1: Where Rust’s Enum Shines by taeric on Tuesday May 05, 2015 @03:47PM (#9494518)
Not in the same way. In Java, you can have an enum that has some data placed on it, at a per value basis. You can not have an enum where different instances of the same value have different values attached to it.

That is, Enum.A will always be Enum.A with the same data on it at all times in Java. This is not the case for ADTs.

Re:Virtual Structs Part 1: Where Rust’s Enum Shines by pcwalton on Tuesday May 05, 2015 @04:23PM (#9494729)
Sure, but having enums with data is not per se out of the ordinary in mainstream languages.