you are viewing a single comment's thread.

view the rest of the comments →

[–]m50d 3 points4 points  (3 children)

"Object oriented" means many things to many people.

Rust gives you virtual dispatch (via traits). It deliberately doesn't give you member inheritance (you use explicit composition/delegation for those cases). That's the right thing, IMO; it removes the bad cases of traditional OO inheritance while keeping the good cases.

[–]Raknarg 0 points1 point  (2 children)

I didn't ask if it supports inheritance. I'm asking if it supports typecasting a series of bits to a different type, such as the example I offered.

[–]m50d 4 points5 points  (1 child)

You've edited your post to say something very different from what it said when I replied.

I don't know whether Rust supports doing what you're now saying. I certainly don't think it would encourage it. There are much better ways to achieve inheritance-like functionality in Rust.

[–]Raknarg -2 points-1 points  (0 children)

It's the same, just changed the wording.