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

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



Hi!

On Friday, January 11, 2002, at 01:30 , Christopher Barber wrote:

>> 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.

Actually, if you pull messages out from interface types and bind 
them to modules directly, and if your language has a module 
construct that is "sealed" in the "Cardelli sense", then there is 
no problem with the safety of this; at least none that I can see 
right now, formal proofs and stuff pending due to lack of education 
on my part (but I am catching up :-). See

    http://nil.ics.uci.edu/~phf/pub/jmlc-2000.pdf

for the "best" discussion I have been able to produce so far (which 
might not be good at all in the end). Comments would be very 
welcome, preferably in private since I am a little embarrassed 
about my lack of formality. :-)

Peter

PS: Of course, you also have to clear up the difference between 
messages and methods that seems to be ignored by a lot of people.
--
Peter H. Froehlich []->[!]<-[] http://nil.ics.uci.edu/~phf/
OpenPGP: D465 CBDD D9D2 0D77 C5AF  353E C86C 2AD9 A6E2 309E