The lack of inheritance is my favorite feature in a programming language
I actually agree. This is my sneaky attempt at educating people about impl Deref. Although, I am still not sure how to feel about it, since I do actually see quite some similarities with inheritance...
impl Deref
@Ephera that feels wrong, somehow ...
You can have the thing you are dereferencing to be a trait, so you can change your "base class" at runtime.
At least, you can't have multiple inheritance with impl Deref (I hope / as far as I can see)
3 Comments
nimpnin@sopuli.xyz · 25 pts · 200d
The lack of inheritance is my favorite feature in a programming language
Ephera@lemmy.ml · 9 pts · 200d
I actually agree. This is my sneaky attempt at educating people about
impl Deref. Although, I am still not sure how to feel about it, since I do actually see quite some similarities with inheritance...goedelchen@mastodontech.de · 6 pts · 200d
@Ephera that feels wrong, somehow ...
You can have the thing you are dereferencing to be a trait, so you can change your "base class" at runtime.
At least, you can't have multiple inheritance with impl Deref (I hope / as far as I can see)