News for hackers. Stuff that matters.
Re:Covariance and Contravariance: a fresh look at an old iss... by shiro on Wednesday May 18, 2016 @12:51PM (#11723320)
Ah, ok, I mixed up you with continuational.

For this context, what I'm saying is that if you don't need to extract an apple from a list of fruits, then you can do it safely with inheritance, so whether using inheritance or delegation is irrelevant. Isn't it?

Re:Covariance and Contravariance: a fresh look at an old iss... by catnaroek on Wednesday May 18, 2016 @03:30PM (#11725036)
If you want to extract an apple from a list of fruits, you need runtime type information (so that you can test whether a particular fruit object happens to be an apple), which has nothing to do with whether your language has inheritance or not. Using runtime type information is a symptom of bad design, though, since it lessens the extent to which you can reason about programs (as pieces of text) by just looking at their types.
Re:Covariance and Contravariance: a fresh look at an old iss... by shiro on Thursday May 19, 2016 @06:22AM (#11729152)
I agree with you all. All I say is that suggesting delegation in place of inheritance to address contravariance issue seems off the mark.