News for hackers. Stuff that matters.
Re:I Don't Use Classes by htns on Thursday March 12, 2020 @01:35PM (#22559410)
That's equivalent to wrapping an enum in a class. Emulations of type hierarchies without OO often fail like this, having a A-or-B be literally the same type so losing out on type safety/forcing constant rechecking of the discriminant.
Re:I Don't Use Classes by afiori on Friday March 13, 2020 @05:06AM (#22565807)
That can be done in Rust by having two different types implement the same interface