News for hackers. Stuff that matters.
Re:Comparing Rust and Java by jmgrosen on Sunday February 28, 2016 @11:33PM (#11193602)
A minor point on a great article, but "On the other hand, Java’s enum values are really singleton classes under the hood – so one can define an abstract method in the enum to implement differently in each value, something that would require a match expression (or hash-table, whose construction at compile time some enterprising Rustaceans have built a crate for) in Rust" isn't quite true -- you can implement methods on enums in Rust, too: http://is.gd/M3VJJR
Re:Comparing Rust and Java by dbaupp on Monday February 29, 2016 @12:11AM (#11193697)
I suspect the author was talking about defining methods for individual variants of an enum, something like

  enum Foo { A, B }
  impl Foo::A { fn method_on_a(&self) {} }
Re:Comparing Rust and Java by da4c30ff on Monday February 29, 2016 @03:59AM (#11194344)
There is an RFC[1] for making enum variants first-class types.

[1]: https://github.com/rust-lang/rfcs/pull/1450

Re:Comparing Rust and Java by llogiq on Monday February 29, 2016 @04:49AM (#11194502)
Exactly. I must admit that my wording was not as understandable as it should have been. I'll see if I can rephrase it to better convey the point.