[Types-sig] Interfaces API: a concrete contact point

Samuele Pedroni pedroni@inf.ethz.ch
Fri, 16 Mar 2001 02:49:16 +0100


Hi.

If we  really aim for having just interfaces (still not convinced about 
that <wink>)  IMHO a possible solution is to define their check this way:

if the input to check against an interface IFace is an instance foo, we 
check if foo has an '__implements__'
attribute in that case we test IFace.isImplementedBy(foo), otherwise we 
check if foo has all the required signatures :).

Then eventually
"class A implements IFace" should check at definition time if A has all 
the needed signatures,
raising warnings for the missing signatures still allowing that way 
incremental coding.

regards