All right, all right! Interim decision regarding qualified Object methods

Jacob Carlborg doob at me.com
Thu Jul 12 23:49:01 PDT 2012


On 2012-07-12 22:20, Steven Schveighoffer wrote:

> Many (most?) classes never care about opHash, opCmp, opEquals and
> toString.  But Object defines them, incorrectly for most cases.
>
> These apathetic classes would not break at all.  And to make the default
> be to inherit those methods would promote their usage or reliance on them.
>
> Not only that, but you are almost *forced* to define them, because you
> don't want accidental incorrect usage of them.  We have lovely
> situations where the only solution is to define a version of the method
> that *always throws* in a statically typed language.
>
> It's really a terrible solution (to force the definition of them) which
> Andrei quite correctly pointed out only existed because of the lack of
> templates back then.
>
> I think this discussion is somewhat academic at this point, as Andrei
> seems not too keen on the idea of having dual base classes.

I was trying to suggest something that is mostly backwards compatible.

-- 
/Jacob Carlborg




More information about the Digitalmars-d mailing list