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

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



> > > If you're suggesting that simply because a class happens to
> > > include methods that match a particular interface, that it
> > > should satisfy that interface, I don't think that's a very
> > > good idea.
> >
> > That is what I am suggesting.  I have mixed feelings about it, but many
> > would argue this is a useful concept.
>
> On this point, I would argue on the "not useful enough" side.  You can use
> 'any' to achieve this, and it's probably better if you do, since use of
> 'any' serves to flag the looseness of the operation.  If a
> declaration like
> "l:Lockable" simply means "check that l happens to include the methods in
> the Lockable interface", the declaration gives a misleadingly strong
> impression that some kind of agreed-upon contract is being satisfied, when
> it isn't necessarily.

The semantics I have in mind would be that there would be compile-time
checking of the contract.

- C