[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Curl, multiple inheritance, and interfaces (was Re: cheerful static typing)

> > The semantics I have in mind would be that there would be compile-time
> > checking of the contract.
> I'm saying that unless the class designer explicitly specifies
> that a class
> supports a particular interface, the fact that it happens to contain a set
> of methods that look like they might belong to that interface isn't good
> enough.  The methods that the compiler is seeing may not even be
> related to
> each other.  No matter when you check this, it's a very weak sort of type
> check, that may give the appearance of being stronger than it really is,
> since variables that are declared as e.g. Lockable, may not be.

All this is true, but think of the case in which you do not have the ability
to add an "implements" clause to a class because it lives in a 3rd party
library which you not allowed to change.

- C